Skip to content

Instantly share code, notes, and snippets.

@AnonymousWS
Created June 12, 2015 14:28
Show Gist options
  • Save AnonymousWS/d79313298638a90e0540 to your computer and use it in GitHub Desktop.
Save AnonymousWS/d79313298638a90e0540 to your computer and use it in GitHub Desktop.
puts "Welcome to a math quiz! "
puts "Lets start! "
puts "What is 2 + 2? "
user_input = gets.chomp.to_i
if user_input == 4
puts "Correct answer! "
elsif
puts "Wrong answer! "
end
puts "What its 3 x 3? "
user_input1 = gets.chomp.to_i
if user_input1 == 9
puts "Correct answer! "
elsif
puts "Wrong answer! "
end
puts "What is 4**3"
user_input2 = gets.chomp.to_i
if user_input2 == 64
puts "Correct answer! "
elsif
puts "Wrong answer! "
end
puts "Whats 225 / 5? "
user_input3 = gets.chomp.to_i
if user_input3 == 45
puts "Correct answer! "
elsif
puts "Wrong answer! "
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment