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

  1. /*
  2.      Program: Rainbow()
  3.      System: GRUMPFISH LIBRARY
  4.      Author: Greg Lief
  5.      Copyright (c) 1988-90, Greg Lief
  6.      Clipper 5.01 version
  7.      Compile instructions: clipper rainbow /n/w/a
  8.  
  9.      Display character string in continuously falling rainbow format
  10. */
  11.  
  12. //───── begin preprocessor directives
  13.  
  14. #include "grump.ch"
  15. #include "inkey.ch"
  16.  
  17. //───── end preprocessor directives
  18.  
  19. function rainbow(cstring)
  20. static colors_ := { 'W', 'BR', 'R', 'GR', 'BG', 'B', 'G' }
  21. local whichcolor := 0, nstart := 3, nrow, mainloop := .t.
  22. GFSaveEnv(, 0)                  // shut off cursor
  23. do while mainloop
  24.    for nrow = nstart to nstart + 2
  25.       SCRNCENTER(nrow, cstring, '+' + colors_[++whichcolor % 7 + 1] + '/N')
  26.       if inkey(.03) != 0
  27.          mainloop := .f.
  28.          exit
  29.       endif
  30.    next
  31.    if nstart < 18
  32.       nstart += 3
  33.    else
  34.       nstart := 3
  35.    endif
  36. enddo
  37. GFRestEnv()
  38. return nil
  39.  
  40. * end function Rainbow()
  41. *--------------------------------------------------------------------*
  42.  
  43. * eof rainbow.prg
  44.