Skip to content

Instantly share code, notes, and snippets.

@MysticDoll
Last active December 6, 2016 08:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MysticDoll/28fba66f179068c3cb799e6a4f1645d9 to your computer and use it in GitHub Desktop.
Save MysticDoll/28fba66f179068c3cb799e6a4f1645d9 to your computer and use it in GitHub Desktop.
「ぁ」と「わ」と「わ」をランダムに連結していって、「ぁわわ」が現れたらそれまでに連結した文字列を出力して終了するJavaScript
var str = "";
const seed = "ぁわ".split("");
while(true) {
str += seed[Math.floor(Math.random() * 10000) % seed.length];
if(/ぁわわ/.test(str))
break;
}
console.log(`${str}、そんな話になってたとは。すみませんm(_\`_)m`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment