Skip to content

Instantly share code, notes, and snippets.

@koki-h
Last active June 4, 2021 15:16
Show Gist options
  • Save koki-h/81f340a42d5ed6c763067954411ae90e to your computer and use it in GitHub Desktop.
Save koki-h/81f340a42d5ed6c763067954411ae90e to your computer and use it in GitHub Desktop.
ワクワクチンチンが出るまでランダムに"ワ","ク","チ","ン"を出す
# inspired by https://anond.hatelabo.jp/20210604154733
CHAR_BOX=%w|ワ ク チ ン|
TARGET_STR="ワクワクチンチン"
current_str_a = []
current_str = ""
while true do
current_str_a.shift if current_str_a.size >= TARGET_STR.size
c = CHAR_BOX.sample
current_str_a << c
current_str = current_str_a.join
puts current_str
break if current_str == TARGET_STR
end
puts "\n"
puts "_人人人人人人人人_"
puts ">#{current_str}<"
puts " ̄Y^Y^Y^Y^Y^Y^Y^Y ̄"
@koki-h
Copy link
Author

koki-h commented Jun 4, 2021

実行結果
スクリーンショット 2021-06-04 22 37 55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment