Newer
Older
Ruby / so-se-zi.rb
@SUZUKI Megumi SUZUKI Megumi on 29 Sep 2023 466 bytes 2023-09-29 22:20:15
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

puts "問題!"
puts "今は西暦何年でしょうか?"
puts "1:2022年"
puts "2:2024年"
puts "3:2023年"

while true
  print"答を入力:"
  kotae =gets.chop.to_i
  if kotae == 1
    puts "ブブー!不正解..."
    break
  elsif kotae == 2
    puts "ブブー!不正解..."
    break
  elsif kotae == 3
    puts "ピンポーン!正解!!"
    break
  else
    puts "その選択肢はないよ!"
    redo
  end
end