home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / misc / mouse.lbr / TEST.MZE / TEST.MSE
Encoding:
Text File  |  1988-07-12  |  1.8 KB  |  55 lines

  1. ~ General test program for Mouse interpreters  7/7/84
  2. "!Arithmetic Expressions: "
  3.    777 223 + !    "=" 3579 2579 - ! "="
  4.    25 40 * !      "=" 7000 7 / !    "="
  5.    5137 1379 \ !  "=1000!"
  6. "Boolean Expressions: "
  7.    789 891 > !    "=" 0 17 - 36 > ! "="    ~ False expressions
  8.    0 1 = ! "="   0 1000 - 1000 = !  "="
  9.    6 5 < ! "=" 1000 0 1000 - < !    "="
  10.    17 18 > 5 5 = * ! "="
  11.    17 18 > 5 6 > + ! "=0     "
  12.    1 0 > ! "=" 0 0 1 - > !   "="           ~ True expressions
  13.    0 0 = ! "=" 1000 1000 = ! "="
  14.    0 17 - 37 < ! "=" 0 1 < ! "="
  15.    17 18 < 6 5 > * !  "="
  16.    5 6 > 1 1 = + ! "=1!"
  17. "Assignments: "
  18.    1000 A: A. ! "=" A. Z: Z. ! "="
  19.    A 25 + . ! "=1000!"
  20. "Conditional Statements: "
  21.    1 0 > [ "OK" ]
  22.    1 0 = [ " *** Error ***" ] "!"
  23. "Loops: "
  24.    0 N:
  25.    ( N. ! " " N. 10<^ N. 1 + N: )
  26.    "!!  "
  27.    0 M:                          ~ Multiplication table
  28.    ( 0 N:
  29.      ( M. N. * ! " "
  30.        N. 10 < ^  N. 1 + N: )
  31.    "!  " M. 2 < ^ M. 1 + M: )
  32. "!Macro Calls: "
  33.    "A: " #A; " "
  34.    "B: "  #B,"OK "; #B,"OK "," *** Error ***";
  35.    "C: "  #C,1,2,3,4; ! "=10 "
  36.    "D: "  #D,#D,1,2;,#D,3,4;; ! "=10!"
  37. "Scope of Variables: "
  38.    "E: "  0 v: #E; v. ! "=1000!"
  39. "Recursive Macros: "
  40.    "G: "  "Enter number to be factored: " #G,? "!";"!"
  41. "End of tests.!"
  42. ~ Macro definitions
  43. $A "OK" @
  44. $B 1% @
  45. $C 1% 2% 3% 4% + + + @         ~ Place sum of four parameters on stack
  46. $D 1% 2% + @                   ~ Place sum of two parameters on stack
  47. $E 1% 100 v: v. ! @            ~ Scope of variable test
  48. $G 1% N: 2 F:                  ~ Display prime factors of 1%
  49.    ( N. F. \ 0 > ^ F. 1 + F: ) ~ F is now smallest factor of N
  50.    F. N. = [ N. ! " "]
  51.    F. N. <
  52.       [ F. ! " "               ~ Display F
  53.         #G,N. F. /;] @
  54. ~ End of definitions
  55.