Вы посетили: calc

Пример: calc

Пример: calc

Простейший калькулятор

calc.dino
if arg == "nil"
	print, "Usage: [first_num] [+|-|*|/] [second_number]"
	exit, 1
end
 
use, "strings"
strings:split, arg, " ", args
if returned < 3
	print, "Missed params!"
	exit, 2
end
 
strings:atoi, args[0]
x = returned
strings:atoi, args[2]
y = returned
op = args[1]
 
res = 0
if op == "+"
	res = x+y
elif op == "-"
	res = x-y
elif op == "*"
	res = x*y
elif op == "/"
	res = x/y
end
 
strings:itoa, res
append, "Result: ", returned
print, returned