Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- if #args ~= 2 then
- args = {...}
- firstArg = args[1]
- symbol = args[2]
- secondArg = args[3]
- else
- args = {...}
- lastAnswer = fs.open("Ans","r")
- firstArg = lastAnswer.readAll()
- symbol = args[1]
- secondArg = args[2]
- lastAnswer.close()
- end
- if symbol == "+" then
- output = firstArg+secondArg
- elseif symbol == "-" then
- output = firstArg-secondArg
- elseif symbol == "/" then
- output = firstArg/secondArg
- elseif symbol == "*" then
- output = firstArg*secondArg
- end
- print(output)
- lastAnswer = fs.open("Ans","w")
- lastAnswer.write(output)
- lastAnswer.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement