2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JavaScriptでもがんばるぞい!

Last updated at Posted at 2014-11-08

パクリです。 Ruby - 今日も1日がんばるぞい! - QiitaPHP - PHPでもがんばるぞい! - Qiita

zoi.html
<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <title>JSでもがんばるぞい!</title>
    <script src="zoi.js"></script>
</head>
</html>
zoi.js
var count=0,
    dic=[["今日","ぞい"],[""],["1","ぞい"],["","ぞい"],["がん","ぞい"],["ばる","ぞい"],["ぞい!"]];

do{
    var arr = [];
    dic.forEach(function(ob){
        var rndm = Math.floor(Math.random()*2);
        arr.push(ob.length == 1 ? ob[0] : ob[rndm]);
    });
    document.write(arr.join("")+"<br>");
    count++;
}while(arr.join("") != "今日も1日がんばるぞい!");

document.write('<br>☆がんばるまで'+ count +'zoiでした☆');

 
もう少し簡潔に書きたい、、、

#疲れた
aaa.jpg

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?