Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --MathTest Shell Modification
- --Running any program requires a multiplication problem to be solved
- --By minimite for ComputerCraft, a minecraft mod that introduces computers for Minecraft
- shell.oldrun = shell.run
- function shell.run(program, ...)
- local q1 = math.random(1,100)
- local q2 = math.random(1,100)
- write("What is "..q1.."*"..q2.."? ")
- local answer = q1*q2
- local uans = tonumber(read())
- if uans == answer then
- shell.oldrun(program, ...)
- else
- print("WRONG! Try again!")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement