我被一个无法正常运行的程序卡住了。这是我的代码:
puts '<Input greeting below>'
answer = gets.chomp
if answer == 'Hello' || 'Hi'
answer == true
else
answer == false
puts 'Hey, how are you?'
answer2 = gets.chomp
if answer2 == 'I\'m good' || 'I\'m doing well'
answer2 == true
else
answer2 == false
puts 'That\'s good. Would you like to know facts about ruby programming?'
answer3 = gets.chomp
if answer3 == 'Sure'
answer3 == true
else
answer3 == false
puts 'Ok, well did you know that {hello, world} was the first program ever made?'
answer4 = gets.chomp
if answer4 == 'Yes'
answer4 == true
else
answer4 == false
puts 'Wow, you\'re pretty good! Would you like to know another fact?'
answer5 = gets.chomp
if answer5 == 'Sure'
answer5 == true
else answer5 == false
puts 'Alright, did you know the programming language "Ruby"
was developed by a Japanese techonolgist named "Yukihiro Matsumoto"
because he wasn\'t satisfied with the other programming languages?'
end
end
end
end
end
Windows CMD 说我在第 29 行的“结束”部分有问题。我想不通。有人可以帮忙吗?