Last active
March 11, 2016 08:09
-
-
Save greymd/63b1b9623daa7ab1bce7 to your computer and use it in GitHub Desktop.
「ズン」と「ドコ」をランダムに無限に生成し「ズン・ズン・ズン・ズン・ドコ」のパターンが出現した時に「キ・ヨ・シ♪」と出力して動作を停止するEgisonのコード。
This file contains hidden or 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
((match-lambda | |
(list string) {[ | |
<join $a | |
(loop $i [1 4] | |
<cons (& ,"ズン" $z_i) ...> | |
(& <cons ,"ドコ" _> $d))> [a z (car d) "キ・ヨ・シ ♪"]]}) | |
(map 1#(R.car {"ズン" "ドコ"}) nats)) | |
# 結果 | |
# [{"ズン" "ズン" "ドコ" "ドコ" "ドコ" "ズン" "ズン" "ドコ" "ズン" "ズン" "ズン" "ドコ" "ズン" "ズン" "ズン" "ドコ" "ドコ" "ドコ"} {|[1 "ズン"] [2 "ズン"] [3 "ズン"] [4 "ズン"]|} "ドコ" "キ・ヨ・シ ♪"] |
egisatoshi
commented
Mar 11, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment