Guest User

Untitled

a guest
Nov 23rd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. calculate (expression)
  2. (a b c)=split expression on " "
  3. if a is a number righthand=a else righthand=calculate(a)
  4. if c is a number lefthand=c else lefthand=calculate(c)
  5. case b
  6. ='+' return lefthand+righthand
  7. ='/' return lefthand/righthand
  8. ='*' return lefthand*righthand
  9. and so on
Add Comment
Please, Sign In to add comment