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

  1. \ Word definition for problem p2.8C
  2. \ Author: Dickson Cheng  03/30/90 13:19:20.33
  3.  
  4. : SPIN          ( a b c -- c b a )
  5.         SWAP ROT ;
  6.  
  7. : HATCH         ( a b c -- a b b c )
  8.         OVER SWAP ;
  9.  
  10. : SHOVE         ( a b c -- c a b c )
  11.         -ROT 2 PICK ;
  12.  
  13. : TANK_AREA     ( l w h -- )
  14.         3DUP            ( l w h -- l w h l w h )
  15.         5 ROLL * 2 *    ( l w h l w h -- w h l w h*l*2 )
  16.         -ROT   * 2 *    ( w h l w h*l*2 -- w h h*l*2 l*w*2 )
  17.         +               ( w h h*l*2 l*w*2 -- w h h*l*2+l*w*2 )
  18.         -ROT   * 2 *    ( w h h*l*2+l*w*2 -- h*l*2+l*w*2 w*h*2 )
  19.         +               ( h*l*2+l*w*2+w*h*2 )
  20.      CR ." Surface area of tank is " . ." square feet" ;
  21.  
  22.