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

  1. \ Problem 3.27 by Dickson Cheng  04/06/90 10:57:06.94
  2.  
  3.  
  4.  
  5. : WHITE         ( -- )
  6.         177 EMIT ;
  7.  
  8. : SPACE?        ( n -- flag )
  9.         32 ( space ) = ;
  10.  
  11. : GAME          ( -- )
  12.         CR CR ." Press the space bar as hard as you can!"
  13.         BEGIN CR
  14.         KEY SPACE? NOT IF
  15.            ." Please space bar only!"
  16.             2000 2 TONE
  17.         ELSE
  18.             CR 64 RND 1+
  19.             DUP 0 ?DO WHITE LOOP CR
  20.             DUP 25 < IF
  21.                ." Press it harder!!"
  22.             ELSE
  23.                 DUP 50 < IF
  24.                     ." Not bad! Press real hard!"
  25.                 ELSE
  26.                         10 0 DO BEEP LOOP
  27.                         DROP ." You just busted your space bar!" EXIT
  28.                 THEN
  29.             THEN DROP
  30.         THEN
  31.         AGAIN ;
  32.  
  33.  
  34.