Created
September 8, 2013 19:27
-
-
Save sirramongabriel/6487681 to your computer and use it in GitHub Desktop.
Spotlight on the first case statement.
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
| case choice | |
| when 'add' | |
| puts "What movie do you want to add?" | |
| title = gets.chomp | |
| if movies[title.to_sym].nil? | |
| puts "What's the rating? (Type a number 0 to 4.)" | |
| rating = gets.chomp | |
| movies[title.to_sym] = rating.to_i | |
| puts "#{title} has been added with a rating of #{rating}." | |
| else | |
| puts "That movie already exists! Its rating is #{movies[title.to_sym]}." | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment