Advertisement
minimite

startup

Nov 2nd, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --MathTest Shell Modification
  2. --Running any program requires a multiplication problem to be solved
  3. --By minimite for ComputerCraft, a minecraft mod that introduces computers for Minecraft
  4.  
  5. shell.oldrun = shell.run
  6.  
  7. function shell.run(program, ...)
  8. local q1 = math.random(1,100)
  9. local q2 = math.random(1,100)
  10. write("What is "..q1.."*"..q2.."? ")
  11. local answer = q1*q2
  12. local uans = tonumber(read())
  13. if uans == answer then
  14. shell.oldrun(program, ...)
  15. else
  16. print("WRONG! Try again!")
  17. end
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement