Last active
December 6, 2016 08:34
-
-
Save MysticDoll/28fba66f179068c3cb799e6a4f1645d9 to your computer and use it in GitHub Desktop.
「ぁ」と「わ」と「わ」をランダムに連結していって、「ぁわわ」が現れたらそれまでに連結した文字列を出力して終了するJavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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