home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / source / p2_9dc.seq < prev    next >
Text File  |  1990-03-30  |  503b  |  25 lines

  1. \ Rectangle program for problem 2.9
  2. \ Author: Dickson Cheng  03/30/90 13:50:38.40
  3.  
  4. : .LW           ( l w -- )
  5.         SWAP
  6.         CR ." Length: " .
  7.         CR ." Width : " . ;
  8.  
  9. : AREA          ( l w -- )
  10.         CR ." Area: " * . ;
  11.  
  12. : PERIMETER     ( l w -- )
  13.         CR ." Perimeter: " + 2 * . ;
  14.  
  15. : RECTANGLE     ( l w -- )
  16.         2DUP .LW
  17.         2DUP AREA
  18.              PERIMETER ;
  19.  
  20. : MESSAGE       ( -- )
  21.         DARK CR ." To run RECTANGLE type l w RECTANGLE." ;
  22.  
  23. MESSAGE
  24.  
  25.