home *** CD-ROM | disk | FTP | other *** search
- ~ General test program for Mouse interpreters 7/7/84
- "!Arithmetic Expressions: "
- 777 223 + ! "=" 3579 2579 - ! "="
- 25 40 * ! "=" 7000 7 / ! "="
- 5137 1379 \ ! "=1000!"
- "Boolean Expressions: "
- 789 891 > ! "=" 0 17 - 36 > ! "=" ~ False expressions
- 0 1 = ! "=" 0 1000 - 1000 = ! "="
- 6 5 < ! "=" 1000 0 1000 - < ! "="
- 17 18 > 5 5 = * ! "="
- 17 18 > 5 6 > + ! "=0 "
- 1 0 > ! "=" 0 0 1 - > ! "=" ~ True expressions
- 0 0 = ! "=" 1000 1000 = ! "="
- 0 17 - 37 < ! "=" 0 1 < ! "="
- 17 18 < 6 5 > * ! "="
- 5 6 > 1 1 = + ! "=1!"
- "Assignments: "
- 1000 A: A. ! "=" A. Z: Z. ! "="
- A 25 + . ! "=1000!"
- "Conditional Statements: "
- 1 0 > [ "OK" ]
- 1 0 = [ " *** Error ***" ] "!"
- "Loops: "
- 0 N:
- ( N. ! " " N. 10<^ N. 1 + N: )
- "!! "
- 0 M: ~ Multiplication table
- ( 0 N:
- ( M. N. * ! " "
- N. 10 < ^ N. 1 + N: )
- "! " M. 2 < ^ M. 1 + M: )
- "!Macro Calls: "
- "A: " #A; " "
- "B: " #B,"OK "; #B,"OK "," *** Error ***";
- "C: " #C,1,2,3,4; ! "=10 "
- "D: " #D,#D,1,2;,#D,3,4;; ! "=10!"
- "Scope of Variables: "
- "E: " 0 v: #E; v. ! "=1000!"
- "Recursive Macros: "
- "G: " "Enter number to be factored: " #G,? "!";"!"
- "End of tests.!"
- ~ Macro definitions
- $A "OK" @
- $B 1% @
- $C 1% 2% 3% 4% + + + @ ~ Place sum of four parameters on stack
- $D 1% 2% + @ ~ Place sum of two parameters on stack
- $E 1% 100 v: v. ! @ ~ Scope of variable test
- $G 1% N: 2 F: ~ Display prime factors of 1%
- ( N. F. \ 0 > ^ F. 1 + F: ) ~ F is now smallest factor of N
- F. N. = [ N. ! " "]
- F. N. <
- [ F. ! " " ~ Display F
- #G,N. F. /;] @
- ~ End of definitions