I have a very basic Lua script that asks a math question
math.randomseed(os.time()) print ("Let's play Math") a = math.random(1,10) b = math.random(1,10) io.write("What is " .. a .. " + " .. b .. "?") answer = io.read() correct = (a + b) if (answer == correct) then print ("Correct") else print ("Wrong") print (correct) --For debug end
For some reason, I am always getting "incorrect" even when answered correctly. I also print out the correct answer, just to make sure the program is handling the math correctly. Where is my mistake?