Created
April 9, 2017 06:45
-
-
Save mmts1007/287c2c45689fa14f5df8e2104ea177a6 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
class Array | |
# 配列の内容が "ズンドコ" か | |
def zundoko? | |
self == %w(ズン ズン ズン ズン ドコ) | |
end | |
end | |
ZUN_DOKO = %w(ズン ドコ) | |
results = [] | |
while !results.zundoko? | |
results << ZUN_DOKO.sample.tap { |z| print z } | |
results.shift if results.length > 5 | |
end | |
puts 'キ・ヨ・シ!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment