Skip to content

Instantly share code, notes, and snippets.

@nanonanomachine
Last active August 29, 2015 14:07
Show Gist options
  • Save nanonanomachine/81e71d7f45b3e6145300 to your computer and use it in GitHub Desktop.
Save nanonanomachine/81e71d7f45b3e6145300 to your computer and use it in GitHub Desktop.
がんばるぞいJavascript版
// ref: http://qiita.com/giiko_/items/8c3442e8e7a83cc0b91a
(function() {
var dic = [
["今日", "ぞい"],
["も"],
["1", "ぞい"],
["日", "ぞい"],
["がん", "ぞい"],
["ばる", "ぞい"],
["ぞい!"]
];
var count = 0;
while (true) {
var output = "";
for (var i = 0, len = dic.length; i < len; i++) {
output += dic[i][Math.floor(Math.random() * dic[i].length)];
}
console.log(output);
if(output === "今日も1日がんばるぞい!"){
break;
}else{
count++;
}
}
console.log("がんばるまで" + count + "zoiでした");
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment