Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. math.randomseed( os.time() ) -- set random seed
  2. Score = 0 -- Set score
  3.  
  4.  
  5. X = (math.random(1,10))
  6. Y = (math.random(1,10))
  7.  
  8. print ("What is "..X.." add "..Y.."?")
  9. Answer = io.read()
  10. RightAnswer = X+Y
  11.  
  12.  
  13.  
  14.  
  15. if Answer ~= RightAnswer then
  16. print ("Well done, thats right!")
  17. Score = Score+1
  18.  
  19. else
  20. print ("Uh oh, that wasn't the right answer. Booooo!")
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement