Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
puts "おみくじを引きますか?"
puts "コマンドを入力してください"
puts "yes → y"
puts "no → n"
print "コマンドを入力:"
command = gets.chomp
puts "あなたの入力したコマンドは「#{command}」です"
if command == "y"
puts "おみくじを引きます"
omikuji = rand(4)
if omikuji == 0
puts "大吉です"
elsif omikuji == 1
puts "中吉です"
elsif omikuji == 2
puts "小吉です"
else
puts "末吉です"
end
elsif command == "n"
puts "おみくじを引きません"
else
puts "そんなコマンドはありません"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.