home *** CD-ROM | disk | FTP | other *** search
- \ Solution to problem 2.13
- \ Author: Dickson Cheng 03/30/90 18:04:29.79
-
- : .ONE ( n -- )
- 12 SPACES
- DUP 8 .R
- DUP DUP * 8 .R
- DUP DUP * * 8 .R ;
-
- : .HEADING ( -- )
- CR CR CR 14 SPACES
- ." NUMBER SQUARE CUBE" ;
-
- : .TABLE ( first last -- )
- .HEADING
- 1+ SWAP \ !!! Should check if last > first
- ?DO CR I .ONE LOOP \ !!! and the cube of "last" should not
- CR CR ; \ !!! be greater than 32767.
-
- : MESSAGE ( -- )
- DARK CR ." To run .TABLE type first last .TABLE" ;
-
- MESSAGE
-
-