私はクリスパインのPsych Test [burrito、taco、wets_bed]プログラムに従っています...はい、私は "Escape :ピナ・コラダの歌 "それ以外は、同じままにしていた。クリスパインRubyをプログラムする方法を教えてください。Ch 9:Psychテストプログラム
しかし、最初の「尋ねる」にはまっています。 。 。助けて?
私はこれを大幅に変更したくなく、プログラムがハングしている場所を見つけようとしています。
# 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 like pina-coladas?'
ask 'Do you like getting caught in the rain?'
risky_business = ask 'Do you know what your sig other likes?'
ask 'Are you into yoga?'
ask 'Do you have half a brain?'
puts 'Just a few more questions.'
ask 'Do like the feel of the ocean?'
ask 'Are you into champagne?'
puts
puts 'DEBRIEFING'
puts 'Thank\'s for all the fish'
puts
puts risky_business
これだけです。 これがRubyのバージョンの問題である可能性がありますか?
ありがとうございます!
AH!ありがとうございました...私はそれがそういう感じだった。 – agentfin