ruby case option / gets.chomp游戏项目

Posted

tags:

篇首语:本文由小常识网(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游戏项目的主要内容,如果未能解决你的问题,请参考以下文章

Ruby的case语句

procs 可以与 Ruby 2.0 中的 case 语句一起使用吗?

ruby cases_datable.rb

在Ruby中将嵌套哈希键从CamelCase转换为snake_case

Github actions rails commands "/bin/ruby: invalid option -: (-h will show valid options) (Runti

ruby 如何在ActionMailer中为各个用户设置* url_options *