Skip to content

Instantly share code, notes, and snippets.

@wannabefro
Created May 6, 2013 15:41
Show Gist options
  • Save wannabefro/5525931 to your computer and use it in GitHub Desktop.
Save wannabefro/5525931 to your computer and use it in GitHub Desktop.
newly paired problem
questions = [{:"What is your name?" => "Arthur"}, {:"What is your quest?" => "The holy grail"},
{:"What is the airspeed velocity of an unlader swallow?" => "African or European?"}]
points = 0
point_value = 1
i = 0
while questions[i] != nil
puts questions[i].keys
answer = gets.chomp.downcase
if answer == questions[i].values[0].downcase
points += point_value
puts "You got it right and you got a point"
else
puts "You go it wrong"
end
i += 1
end
if points != 0
puts "You got #{points} points"
else
puts "You did not earn any points"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment