require 'csv'

# CSVファイルから問題を読み込む
questions = [ ]
CSV.foreach('questions.csv') do |row|
  questions << row[0]
end

score = 0
index = 0

while index < questions.length
  puts "第#{index + 1}問: #
{quesutions[index]}"
  print "入力: "
  input = gets.chomp

  if input == questions[index]
    puts "正解!"
    score += 10
  else
    puts "間違い!"
  end

  index += 1
end

puts "あなたのスコアは#{score}点です。"
