home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-11 | 1.0 KB | 30 lines | [TEXT/McSk] |
- \ No Weighting demo from Starting Forth Chapter 12
- \ NOTE: If it says: ' STRING ? ' below,
- \ load the file 'Brodie' first.
-
- variable DENSITY variable THETA variable I.D.
- : ," ( -- ) here 34 string ;
- : .SUBSTANCE i.d. @ count type space ;
- : MATERIAL ( 'string density theta -- ) create , , ,
- does> dup @ theta ! 2+ dup @ density ! 2+ @ i.d. ! ;
-
- : FOOT ( feet -- scaled-height ) 10 * ;
- : INCH ( scaled-height -- scaled-height' )
- 100 12 */ 5 + 10 / + ;
-
- : /TAN ( n -- n' ) 1000 theta @ */ ;
- : PILE ( scaled-height -- )
- dup dup 10 */ 1000 */ 355 339 */ /tan /tan
- density @ 200 */ ." = " . ." tons of " .substance ;
-
- \ table of materials
- \ string-address density theta
- ," cement" 131 700 material CEMENT
- ," loose gravel" 93 649 material LOOSE-GRAVEL
- ," packed gravel" 100 700 material PACKED-GRAVEL
- ," dry sand" 90 754 material DRY-SAND
- ," wet sand" 118 900 material WET-SAND
- ," clay" 120 727 material CLAY
-
- CEMENT
-