home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
forth
/
compiler
/
fpc
/
source
/
p2_13bs.seq
< prev
next >
Wrap
Text File
|
1990-03-29
|
627b
|
28 lines
\ 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 ;