Last active
June 4, 2021 15:16
-
-
Save koki-h/81f340a42d5ed6c763067954411ae90e 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
# 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 ̄" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
実行結果
![スクリーンショット 2021-06-04 22 37 55](https://user-images.githubusercontent.com/52752/120810424-ff54c580-c585-11eb-9f44-29d178dc05dd.png)