lego11

Untitled

Aug 25th, 2014
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1.  
  2.  
  3. function clear()
  4. term.clear()
  5. term.setCursorPos(1,1)
  6. end
  7.  
  8. clear()
  9. print("Aperture Calc")
  10. print("Copright (C) 1970 Aperture Labs")
  11. print("")
  12. print("")
  13. write"Number 1: "
  14. num1 = tonumber(read())
  15. clear()
  16. write"Number 2: "
  17. num2 = tonumber(read())
  18. clear()
  19. write"Action: "
  20. act = read()
  21.  
  22. if act == "+" then
  23. ans = num1 + num2
  24. elseif act == "-" then
  25. ans = num1 - num2
  26. elseif act == "*" then
  27. ans = num1 * num2
  28. elseif act == "/" then
  29. ans = num1 / num2
  30. end
  31. clear()
  32. write(num1.." "..act.." "..num2.." = "..ans)
  33. print("")
  34. print("Press any key to exit")
  35. os.pullEvent("key")
Advertisement
Add Comment
Please, Sign In to add comment