Advertisement
TheFastFish

3var SB interpret

Feb 12th, 2016
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. 'all programs start with
  2. OPTION STRICT
  3. VAR A#
  4. VAR B#
  5. VAR R#
  6. VAR I%
  7.  
  8. 'the following lines are per-instruction
  9. i: INC A#
  10. d: DEC A#
  11. s: A#=A#*A#
  12. p: ?A#
  13. P: ?CHR$(A# AND &HFFFF)
  14. x: A#=ABS(A#)
  15. >: A#=R#
  16. a: INC B#
  17. k: DEC B#
  18. m: B#=B#*B#
  19. o: ?B#
  20. O: ?CHR$(B# AND &HFFFF)
  21. 0: B#=ABS(B#)
  22. <: B#=R#
  23. +: R#=A#+B#
  24. -: R#=A#-B#
  25. *: R#=A#*B#
  26. /: R#=A#/B#
  27. ^: R#=POW(A#,B#)
  28. w: ?R#
  29. u: if statement condition A#>B#
  30. U: if statement condition A#<B#
  31. =: if statement condition A#==B#
  32. (: start an if statement body
  33. ): end an if statement body
  34. |: set loop as WHILE A#>B#
  35. _: set loop as WHILE A#<B#
  36. \: set loop as WHILE A#==B#
  37. f: set loop as FOR I%=1 TO FLOOR(A#)
  38. F: set loop as FOR I%=1 TO FLOOR(B#)
  39. {: WHILE #TRUE
  40. }: WEND
  41. [: open marked loop
  42. ]: close marked loop
  43. ': LINPUT "";S$:R#=ASC(S$[0])
  44. ": INPUT "",R#
  45. r: A#=0:B#=0:R#=0
  46. @: A#=0
  47. #: B#=0
  48. e: R#=0
  49. $: toggle comment
  50. ~: line comment (')
  51. `: ignore next character
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement