Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. function printQuestion()
  2. --Question
  3.  
  4. print("Type in the answer below.")
  5. end
  6.  
  7. local answer = "100"
  8. local input = 0
  9.  
  10. while true do
  11. term.clear()
  12. term.setCursorPos(1,1)
  13. printQuestion()
  14. input = io.read()
  15.  
  16. if input == answer then
  17. term.setTextColor(colors.green)
  18. textutils.slowPrint("Correct!")
  19. redstone.setOutput("left",true)
  20. while true do
  21. sleep(2)
  22. end
  23. else
  24. term.setTextColor(colors.red)
  25. textutils.slowPrint("Incorrect")
  26. sleep(0.5)
  27. term.setTextColor(colors.white)
  28.  
  29. end
  30.  
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement