home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a067 / 1.img / GRUMP501.EXE / BLANK4.PRG < prev    next >
Encoding:
Text File  |  1991-04-29  |  2.0 KB  |  66 lines

  1. /*
  2.     Program: BLANKSCR3()
  3.     System: GRUMPFISH LIBRARY
  4.     Author: Greg Lief
  5.     Copyright (c) 1988-90, Greg Lief
  6.     Clipper 5.01 Version
  7.     Compile instructions: clipper blank4 /n/w/a
  8.  
  9.     Geez!!  Not another screen-blanker!?  But this one is the coolest
  10.     of all of them - the planetarium!  NOTE: this still uses hard-coded
  11.     colors because the colors should be left alone for best effect.
  12.  
  13.     Calls: GFRAND()      (function in $RAND.PRG)
  14. */
  15.  
  16. //───── begin preprocessor directives
  17.  
  18. #include "setcurs.ch"
  19. #include "grump.ch"
  20.  
  21. //───── end preprocessor directives
  22.  
  23.  
  24. function blankscr3(delay)
  25. local mstart := seconds(), mtop := 11, mbott := 14, buffer, ;
  26.       spaces_[45], kounter, mmrow, mmcol, key, xx
  27. afill(spaces_, -1)
  28. do while nextkey() = 0 .and. seconds() - mstart < delay
  29. enddo
  30. if nextkey() == 0        && i.e., the do while loop timed out with no keypress
  31.    GFSaveEnv(.t., 0, "+bg/n")
  32.    cls
  33.    key := kounter := 0
  34.    do while key == 0
  35.       kounter := if(kounter < 45, kounter + 1, 1)
  36.       xx := gfrand((maxrow() + 1) * (maxcol() + 1))
  37.       if spaces_[kounter] > -1
  38.          mmrow := int(spaces_[kounter] / (maxcol() + 1) )
  39.          mmcol := int(spaces_[kounter] % (maxcol() + 1) )
  40.          if gfrand(100) < 45
  41.             @ mmrow, mmcol ssay chr(250) color "+w/n"
  42.             key := max(inkey(.15), key)
  43.          else
  44.             @ mmrow, mmcol ssay chr(04) color "+w/n"
  45.             key := max(inkey(.12), key)
  46.             @ mmrow, mmcol ssay chr(254) color "+w/n"
  47.             key := max(inkey(.12), key)
  48.             @ mmrow, mmcol ssay chr(15) color "+w/n"
  49.             key := max(inkey(.12), key)
  50.          endif
  51.          @ mmrow, mmcol ssay chr(32)
  52.       endif
  53.       spaces_[kounter] := xx
  54.       @ int(xx / (maxcol() + 1)), int(xx % (maxcol() + 1)) ssay chr(250) ;
  55.                color "+bg/n"
  56.       key := max(inkey(.01), key)
  57.    enddo
  58.    GFRestEnv()
  59. endif
  60. return NIL
  61.  
  62. * end function blankscr3()
  63. *--------------------------------------------------------------------*
  64.  
  65. * eof blank4.prg
  66.