Advertisement
KingofGamesYami

Algebra Calculator

Feb 13th, 2013
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.17 KB | None | 0 0
  1. equ = 1
  2. var = 2
  3. varleft = 1
  4. var1 = 1
  5. var2 = 1
  6. var3 = 1
  7. num1 = 1
  8. num2 = 1
  9. var21 = 1
  10. var22 = 1
  11. var23 = 1
  12. num21 = 1
  13. num22 = 1
  14. leftconfig = variableintegervariable
  15. op1 = 1
  16. plus = add
  17. times = multiply
  18. minus = subtract
  19. divide = divide
  20. ans = 1
  21. fans = 1
  22.  
  23. print ("Welcome to King's Algebra Calculator /nHow many equations?")
  24. equ = read()
  25. print(How many variables?")
  26. var = read()
  27. if var == (1) then
  28. print("how many variables are on the left side of the equals sign?")
  29. varleft = read()
  30. if varleft == (1) then
  31.  print("what is the configuration of integers of variables? example: variablevariableinteger")
  32.  leftconfig = read()
  33.  if leftconfig == "variable integer" then
  34.   print("what is the integer?"
  35.   num1 = read()
  36.   print("what is the operation between them? HINT: spell it out")
  37.   op1 = read()
  38.   print("what number is on the right?")
  39.   num2 = read()
  40.   if op1 == (plus)then
  41.    num2-num1 = ans
  42.   if op1 == (minus)then
  43.    num1+num2 = ans
  44.   if op1 == (times)then
  45.    num2\num1= ans
  46.   if op1 == (divide)then
  47.    num2*num1=ans
  48.   ans/var1=fans
  49.   print(fans)
  50.  if varleft == (0) then
  51.   print("what number is on this side?")
  52.   num1= read()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement