Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DEF ADD(X,Y)
- RETURN X+Y
- END
- DEF SUB(X,Y)
- RETURN X-Y
- END
- DEF MUL(X,Y)
- RETURN X*Y
- END
- DEF DIV
- RETURN X/Y
- END
- DEF MAIN
- INPUT NUM1%
- INPUT NUM2%
- INPUT OP$
- PRINT "ADD, SUB, MUL, or DIV"
- PRINT CALL(OP$, NUM1$, NUM2$)
- END
- 'This is compressed using a SmileBASIC minifier
- 'This is the result:
- DEF D0#(X,Y)RETURN X+Y:END:DEF D1$(X,Y)RETURN X-Y:END:DEF D2%(X,Y)RETURN X*Y:END:DEF D3#:RETURN X/Y:END:DEF D4$:INPUT NUM1%INPUT NUM2%INPUT OP$?"D0#, D1$, D2%, or D3#"?CALL(OP$,NUM1$,NUM2$)END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement