home *** CD-ROM | disk | FTP | other *** search
- \ Comp 462
- \ Balraj Sidhu Set: 14D4
- \ Date: April 3, 1990
- \ Problem 3.2
-
-
-
- \ print double numbers on the stack
-
- : .sd1 ( -- )
- depth ?dup if
- 0 ?do depth i - 1- pick
- depth i - 2- pick
- d. 8 emit \ back up one space
- ascii . emit \ indicate double word
- 2 +loop
- else ." Empty" then ;
-
- \ print all single numbers on the stack
- : .ss ( -- )
- depth ?dup if
- 0 ?do depth i - 1- pick
- . 8 emit \ back up one space
- loop
- else ." Empty" then ;
-
- : .sd ( -- )
- depth 1 and if
- .ss
- else
- .sd1
- then ;
-
-
-