home *** CD-ROM | disk | FTP | other *** search
- \ Comp 462
- \ Balraj Sidhu Set: 14D4
- \ Date: March 29, 1990
- \ Problem 2.13 -- Finding the error in the table
-
-
- \ New word: .R ( n w -- )
- \ Print n right justified in a field w wide
- : .one ( n -- )
- 12 spaces \ Indent table entry
- dup 8 .r \ print number
- dup dup * 8 .r \ print square of number
- dup dup * * 8 .r ; \ print cube of number
-
- : .heading ( -- -- )
- cr cr cr 14 spaces ." Number Square Cube" ;
-
- : .table ( first last --- )
- .heading
- 1+ swap
- ?do cr i .one loop
- cr cr ;
-
-
-
-
-
-