-
-
Save jcasimir/1531602 to your computer and use it in GitHub Desktop.
Shopping game
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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