4. Prompting: Redux!


Hi guys, I'm having trouble with this section. I keep getting different error messages; one of them including "Oops, try again. Did you create a variable called title?"
"(ruby):1: syntax error, unexpected ':', expecting tASSOC
'Amelie': '9',
(ruby):1: syntax error, unexpected ',', expecting $end"

I'm having trouble understanding what to do from the error message, and I even tried copying and pasting the model code that Codeacademy offers, just out of curiosity to see if I could pinpoint my mistake, and even that returns with an error message... So, if the model isn't even working, I feel like I'm way off...

movies = {
    'Amelie': '9',
    'Rogue_One': '10',
    'Pans_Labyrinth': '8',

puts "What would you like to do?"
puts " Type 'add' to add a movie."

choice = gets.chomp

case choice
when 'add'
    puts "Type in a movie title, ya jerk."
    title = gets.chomp
    puts "Give me your freakin' rating."
    rating = gets.chomp
    puts "Your freakin' movie #{title} has been added with your freakin', rating #{rating} ...jerk."
when 'update'
    puts "Updated!"
when 'display'
    puts "Movies!"
when 'delete'
    puts "Deleted!"
    puts "Error!"

Any tips would be much appreciated! I'm sure the answer is simple and obvious. That seems to be the pattern, but this one has me stuck...


Start by removing the ' ' in your movies hash --> Amelie: 9,
That should narrow down the errors. After that you should be able to figure it out more easily.


PS: I love your freakin' strings.


OK, I'm not even really sure how it worked, but it works now, after a few adjustments, but I did start with your tip. So, thanks! Much appreciated!
PS: freakin' thanks


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.