Last active
August 29, 2015 14:02
-
-
Save cloneko/dfa1065698c107c00bec to your computer and use it in GitHub Desktop.
おごってもらうJS
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
<!doctype html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>JS</title> | |
<script> | |
function isLive(){ | |
// 約20%の確率?で返事をしなくなる。 | |
return Math.random() < 0.8 ? true : false; | |
} | |
</script> | |
</head> | |
<body> | |
<script> | |
while(isLive()){ | |
// 何の圧力かわからないが、デフォルトはyesらしい… | |
var response = window.prompt("よなしろせんせーおごってください!","yes"); | |
// yesって言ってくれないとオゴってくれることにはならない。 | |
if(response != 'yes'){ | |
// 表面上 | |
alert("(´・ω・`)"); | |
// 心の中 | |
console.log("チッ"); | |
continue; | |
} | |
alert("先生におごってもらう(・ิω・ิ);"); | |
console.log("ちょろいぜ…へへへ…"); | |
} | |
document.write("よなしろせんせーは返事をしなくなった。"); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment