Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- image = paintutils.loadImage("calc")
- cuunter = "-"
- local function clear()
- term.clear()
- term.setCursorPos(4,3)
- end
- clear()
- local function cursor()
- term.setCursorPos(4,3)
- end
- local function cursor2()
- term.setCursorPos(3,3)
- end
- local function cursor3()
- term.setCursorPos(4,4)
- end
- local function cursor4()
- term.setCursorPos(4,5)
- end
- local function cursor5()
- term.setCursorPos(4,6)
- end
- local function ERROR()
- term.clear()
- write"ERROR"
- sleep(2)
- term.clear()
- end
- while true do
- number1 = read()
- cursor2()
- action = read()
- cursor3()
- number2 = read()
- if action == "+" then
- cursor4()
- print("----")
- cursor5()
- print(number1+number2)
- sleep(2)
- clear()
- end
- if action == "-" then
- cursor4()
- print("----")
- cursor5()
- print(number1-number2)
- sleep(2)
- cllear()
- end
- if action == "*" then
- cursor4()
- print("----")
- cursor5()
- print(number1*number2)
- sleep(2)
- clear()
- end
- if action == "/" then
- cursor4()
- print("----")
- cursor5()
- print(number1/number2)
- sleep(2)
- clear()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement