Last active
April 23, 2016 08:21
-
-
Save izumin5210/5c48f0adef9296e311efcbb47abe6fe8 to your computer and use it in GitHub Desktop.
ズンドコペアプロのライブコーディングで書いたやつ
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
# 詰めると1行(68文字) | |
# s="";(print c=%w(ズン ドコ).sample;s+=c)until s[/(ズン){4}ド/];puts"キ・ヨ・シ!” | |
# きれいに書くとこんなかんじ | |
dic = %w(ズン ドコ) | |
msg = "" | |
# 「ズンドコが完成していない」間はループが回る | |
until msg[/(ズン){4}ド/] | |
# ちゃんとした正規表現マッチング | |
# until /(ズン){4}ド/ =~ msg | |
# 正規表現つかわないパターン | |
# until msg.end_with?("#{'ズン' * 4}ドコ") | |
# ズンかドコを取り出す | |
chunk = dic.sample | |
print chunk | |
# ズンドコを記録する | |
msg += chunk | |
end | |
puts "キ・ヨ・シ!” |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment