def read_txt
@file = []
@next_question = true
IO.foreach("text.txt") do |line|
text = line.chomp.gsub("\xEF\xBB\xBF", "")
if text == ""
@next_question = true
else
if @next_question
@file.push([text])
@next_question = false
else
@file[-1].push(text)
end
end
end
$m5_question = @file
end
read_txt if true
class Game_Interpreter
def chouti(question,answer,amount,*var)
temp = $m5_question.sample
$game_variables[question] = temp[0]
$game_variables[answer] = temp[1]
$game_variables[amount] = temp.size - 1
var.shuffle!
temp.each_with_index do |wrong,index|
next if index < 2
var_id = var[index-2]
$game_variables[var_id] = wrong if var_id
end
end
end