Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num = nil
- input = nil
- print("min random?")
- startRand = io.read()
- print("max random?")
- randomizer = io.read()
- print("min additions?")
- minAdd = io.read()
- print("max additions?")
- maxAdd = io.read()
- while true do
- total = 0
- additions = math.random(minAdd,maxAdd)
- message = "What is "
- for i=1,additions do
- num = math.random(startRand,randomizer)
- total = total + num
- message = message .. num
- if (i < additions) then
- message = message .. " + "
- end
- end
- print (message)
- input = io.read()
- if tonumber(input) == total then
- print("you got it right !")
- else
- print("you might have got it wrong, or its a bug")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement