Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- clear()
- print("Aperture Calc")
- print("Copright (C) 1970 Aperture Labs")
- print("")
- print("")
- write"Number 1: "
- num1 = tonumber(read())
- clear()
- write"Number 2: "
- num2 = tonumber(read())
- clear()
- write"Action: "
- act = read()
- if act == "+" then
- ans = num1 + num2
- elseif act == "-" then
- ans = num1 - num2
- elseif act == "*" then
- ans = num1 * num2
- elseif act == "/" then
- ans = num1 / num2
- end
- clear()
- write(num1.." "..act.." "..num2.." = "..ans)
- print("")
- print("Press any key to exit")
- os.pullEvent("key")
Advertisement
Add Comment
Please, Sign In to add comment