oblinger

calc

Mar 19th, 2014
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. tArgs = {...}
  2.  
  3. num1 = tonumber(tArgs[2])
  4. num2 = tonumber(tArgs[3])
  5.  
  6. if tArgs[1] == "add" or tArgs[1] == "a" then
  7. sum = num1 + num2
  8. print(sum)
  9. elseif tArgs[1] == "minus" or tArgs[1] == "m" or tArgs[1] == "subtract" or tArgs[1] == "s" then
  10. diff = num1 - num2
  11. print(diff)
  12. elseif tArgs[1] == "times" or tArgs[1] == "t" or tArgs[1] == "multiply" or tArgs[1] == "mu" then
  13. pro = num1 * num2
  14. print(pro)
  15. elseif tArgs[1] == "divide" or tArgs[1] == "div" then
  16. div = num1/num2
  17. print(div)
  18. end
Advertisement
Add Comment
Please, Sign In to add comment