篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby case option / gets.chomp游戏项目相关的知识,希望对你有一定的参考价值。
puts "Chronicles of the Foodie Turned Vegan"
puts "What do you want to do?"
puts "Options: Eat KFC, Eat Burger King, Eat Chipotle"
option = gets.chomp
case option
when "Eat KFC"
puts "Foodie's Positive Sub-Concious: \"Terrible
Choice.Do you REALLY want to do that?\""
puts "Foodie's Negative Sub-Concious: \"Mmmmm get
the Oily Fried Chicken with Potatoe Wedges!\""
puts "*Vegan Foodie ignores negative Sub-Concious
and eats cauliflower bbq nuggets instead*"
when "Eat Burger King"
puts "Try a veggie burger instead. It'll save your life"
when "Eat Chipotle"
puts "Foodie's Sub Concious: \"GET CHICKEN!
GET CHICKEN!\""
else
puts "Make sure its healthy!"
puts "Foodie's Sub Concious: \"You're really passing up on
some fast food??\""
end
puts "Chronicles of the Foodie Turned Vegan"
puts "What do you want to do?"
puts "Options: Eat KFC, Eat Burger King, Eat Chipotle"
option = gets.chomp
case option
when "Eat KFC"
puts "Foodie's Positive Sub-Concious: \"Terrible
Choice.Do you REALLY want to do that?\""
puts "Foodie's Negative Sub-Concious: \"Mmmmm get
the Oily Fried Chicken with Potatoe Wedges!\""
puts "*Vegan Foodie ignores negative Sub-Concious
and eats cauliflower bbq nuggets instead*"
when "Eat Burger King"
puts "Try a veggie burger instead. It'll save your life"
when "Eat Chipotle"
puts "Foodie's Sub Concious: \"GET CHICKEN!
GET CHICKEN!\""
else
puts "Make sure its healthy!"
puts "Foodie's Sub Concious: \"You're really passing up on
some fast food??\""
end
以上是关于ruby case option / gets.chomp游戏项目的主要内容,如果未能解决你的问题,请参考以下文章