home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / source / p3_29dc.seq < prev    next >
Text File  |  1990-04-06  |  718b  |  17 lines

  1. \ Problem 3.29 by Dickson Cheng  04/06/90 14:50:14.87
  2.  
  3. : BAR ( -- ) 220 EMIT ;
  4.  
  5. : HISTOGRAM     ( f1 f2 f3 ...fn -- )
  6.         CR DEPTH DUP 0      ( ??? -- f1 f2 f3 ... fn depth limit start )
  7.         ?DO CR              ( ??? -- f1 f2 f3 ... fn depth )
  8.             DUP >R          ( ??? -- f1 f2 f3 ... fn depth )
  9.             DUP ROLL        ( ??? -- f2 f3 ... fn depth f1 )
  10.             DUP 0           ( ??? -- f2 f3 ... fn depth f1 limit start )
  11.             ?DO BAR LOOP    ( ??? -- f2 f3 ... fn depth f1 )
  12.             SPACE DUP .     ( ??? -- f2 f3 ... fn depth f1 )
  13.             SWAP R> DROP    ( ??? -- f2 f3 ... fn f1 depth )
  14.         LOOP
  15.         0 ?DO DROP LOOP CR;  ( f1 f2 f3 ... fn depth -- )
  16.  
  17.