home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a079 / 1.img / FPDG.LZH / VOL2NUM0 / FLIPCOIN / FLIPCOIN.APP (.txt) next >
Encoding:
MS Visual FoxPro App  |  1993-02-01  |  1.2 KB  |  17 lines

  1. HEADS
  2. roman
  3. TAILS
  4. roman
  5. Flip another coin? (Y/N):
  6. Heads:
  7. Tails: 
  8. ANSWER
  9. TAILS
  10. HEADS
  11. The FLIPCOIN.PRG illustrates the use of the RAND() function as presented in Chapter 5. RAND() is a pseudorandom number generator that generates a number between 0.0 and 1.0. In FLIPCOIN.PRG, if RAND() returns a number less than 0.5, a circle with "TAILS" in it displays. Otherwise, it displays a circle with "HEADS" in it. It counts and reports the number of heads and tails as you repeat its operation.
  12. FLIPCOIN.PRG
  13. h:\foxprow\
  14. FLIPCOIN.FXP
  15. f:\jebwin\vol2num0\flipcoin\
  16. FLIPCOIN.ART
  17.