Skip to content

Instantly share code, notes, and snippets.

@jcasimir
Forked from eliseworthy/shopping_game.rb
Created December 29, 2011 03:31
Show Gist options
  • Save jcasimir/1531602 to your computer and use it in GitHub Desktop.
Save jcasimir/1531602 to your computer and use it in GitHub Desktop.
Shopping game
def get_move(message)
puts message
prompt # What does this method do?
gets.chomp.downcase
end
def department_stores
message = "You kept walking ahead. There are two department stores in front of you." +
"Do you want to go to WALMART or Nordstroms?"
while true
case get_move(message)
when "walmart" then dead("Massive horde at the blue light special! You're trampled to death.")
when "nordstroms" then nordstroms
when "go back" then left_side
else puts("What? I have no idea what store that is.")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment