Skip to content

Instantly share code, notes, and snippets.

Created September 17, 2015 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/12c57c28aff452442929 to your computer and use it in GitHub Desktop.
Save anonymous/12c57c28aff452442929 to your computer and use it in GitHub Desktop.
code
while
num1=rand(10)
num2=rand(10)
puts "#{num1}*#{num2} ?"
answer=gets.chomp
answer.to_i
correct_answer=num1*num2
if answer==correct_answer
puts " "
puts " "
puts "Correct!"
puts " "
puts " "
else
puts " "
puts " "
puts "WRONG!!! Think about it and try again"
puts " "
puts " "
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment