Created
May 6, 2013 15:41
-
-
Save wannabefro/5525931 to your computer and use it in GitHub Desktop.
newly paired problem
This file contains 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
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