home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / GENASM / LOTTO.LBR / LOTTO.DZC / LOTTO.DOC
Text File  |  2000-06-30  |  3KB  |  67 lines

  1.                                LOTTO
  2.               A Multi-purpose Random Number Generator
  3.                             by John Fox
  4.     
  5. INTRODUCTION
  6.  
  7. This program is a reasonably flexible random number generator which
  8. in its default mode will simulate the LOTTO 6/49 lottery drawings
  9. that are common to New York, California, and perhaps some other
  10. states.
  11.  
  12. For a LOTTO simulation, simply reply to the first three queries of
  13. the program with a carriage return and you are off and running.
  14.  
  15. GENERAL USES
  16.  
  17. Beyond a LOTTO number generator, the program can be used for some
  18. informal playing around with random numbers.  It asks three
  19. questions of the user:
  20.  
  21. 1. How many numbers are to be chosen?
  22. 2. What is the greatest value a number can have?
  23. 3. Should they be non-zero, unique numbers or
  24.    should zero and repeats be allowed?
  25.  
  26. The program does not allow more than 12 numbers to be chosen nor
  27. does it allow a maximum value of more than 99 for any number. 
  28. Those are the only restraints.
  29.  
  30. Assuming unique, non-zero drawings (as in LOTTO) one could, for
  31. example, simulate the drawing of a 5-card hand from a pack of 52
  32. cards by setting the maximum value for any number at 52 and the
  33. number of selections at 5.  To generate a random ordering of the
  34. numbers from 1 to 10 one would set the maximum value at 10 and the
  35. number of selections at 10.
  36.  
  37. Answering the third question to allow zero and repeat numbers, one
  38. can generate longer random numbers.  By setting the maximum value
  39. allowed at 9 each number selected becomes, in effect, the digit of
  40. a longer number.  Thus, for example, by making the number of
  41. selections 5 one would generate 5-digit random numbers.
  42.  
  43. CUSTOMIZING
  44.  
  45. The numeric values chosen at the start of the program can be made
  46. the default values by exiting the program and then saving its
  47. image by typing SAVE 12 FILE.COM and the A> prompt.  The one other
  48. item that may need customizing is the clearscreen operation.  If
  49. your console does not respond to a simple 1Ah (installed in the
  50. distribution version of the program) you may patch a string in the
  51. program beginning at location 103h.  Five bytes are available and
  52. whatever is installed must be followed by a 00h. 
  53.  
  54. A NOTE ON RANDOM-NESS
  55.  
  56. The program does not perform pseudo random selections (like those
  57. done by BASIC).  Just how perfectly random this program's
  58. selections are I cannot swear, but they derive from the refresh
  59. register of the Z80 chip which is in constant and rapid flux, and
  60. the underlying randomizing routine (by Robert Zimmerer -
  61. Microsystems 10/83) seems pretty good.  I have not run any of my
  62. own tests on this implementation.  If someone does I would be
  63. interested in the results.
  64.  
  65.                 John Fox
  66.                 January 15, 1987
  67.                 Compuserve #72436,3652                   If someone does I