因此,我正在跟随Chris Pine进行心理测试[burrito,taco,wets_bed]计划...是的,我改为"Escape:The Pina Colada song"的歌词,但不然,保持不变.
然而,它仍然停留在第一个"问"上...救命?
我不想彻底改变这一点,只是想找到程序挂起的地方.
# Nice little questionnaire
def ask question
good_answer = false
while (not good_answer)
puts question
reply = gets.chomp.downcase
if (reply == 'yes' or reply == 'no' )
good_answer == true
if reply == 'yes'
answer = true
else
answer = false
end
else
puts 'Please answer "yes" or "no".'
end
end
answer # This is what we return (true or false)
end
puts 'Hello, and thank you for smoking.'
puts
ask 'Do you …Run Code Online (Sandbox Code Playgroud)