home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / disks / disk430.lzh / Lotto / README < prev    next >
Text File  |  1991-01-11  |  5KB  |  134 lines

  1. FLORIDA LOTTO PROGRAM v1.0
  2. © Copyright 1988 Timm Martin
  3. All Rights Reserved
  4.  
  5. This program may be distributed freely as long as
  6. this notice remains intact.  This program may not
  7. be sold individually or as part of a group without
  8. the express written consent of the author.
  9.  
  10. This program is for entertainment only and is sold
  11. without any express or implied warranties whatsoever.
  12. The user must assume the entire risk of using the
  13. program (hey, you don't need my help to lose your
  14. money).  Any liability of the author will be limited
  15. to a refund of the purchase price (which is nothing).
  16.  
  17. Send all compliments, complaints, and monetary
  18. expressions of gratitude to:
  19.  
  20.   Timm Martin
  21.   11325 94th Street North
  22.   Largo, FL 34643
  23.  
  24. My only request is that if you win BIG using this
  25. program, please mention to everyone that you used
  26. this program to generate your winning numbers.
  27.  
  28. ---------------------------------------------------------------------
  29.  
  30. CONTENTS OF THIS PACKAGE:
  31.  
  32.   program      - executable LOTTO program
  33.   program.c    - 'C' source code to the LOTTO program
  34.   program.info - icon for the LOTTO program (check it out)
  35.   README       - what you are reading now
  36.  
  37. ---------------------------------------------------------------------
  38.  
  39. TO EXECUTE THIS PROGRAM:
  40.  
  41. To execute this program, either double click on the icon
  42. or type "program" (without the quotes) from the CLI.
  43. You will notice a long red box and two gadgets in a purple
  44. screen.  Click on the left gadget to display in the red
  45. box six LOTTO numbers between 1 and 49.  To quit the
  46. program, click on the right gadget.  Since the screen's
  47. depth gadgets are hidden by this program, just press
  48. LEFT-AMIGA-N and LEFT-AMIGA-M (or COMMODORE-N and M if you
  49. have an Amiga 500 or 2000) to toggle back and forth between
  50. this and the Workbench screen.
  51.  
  52. ---------------------------------------------------------------------
  53.  
  54. TO COMPILE THIS PROGRAM:
  55.  
  56. At the CLI, just type:
  57.  
  58.   cc program.c
  59.   ln program.o -lc
  60.  
  61. This is set up for Manx users.  Sorry, Lattice users, you're
  62. on your own.  The program compiles without any warnings using
  63. Manx v3.6a.  If you have an earlier version of the compiler,
  64. remove the compiler directive line that says:
  65.  
  66.   #include <intuition/screens.h>
  67.  
  68. ---------------------------------------------------------------------
  69.  
  70. HOW THE LOTTO NUMBERS ARE GENERATED:
  71.  
  72. There are many possible ways to generate six LOTTO numbers
  73. between 1 and 49, so I chose what I believe to be the most
  74. straightforward method.  I create an array containing in
  75. ascending order the 49 integers between 1 and 49, then ask
  76. a random number function to choose one of the elements.
  77. The number in that element is stored and removed from the
  78. array.  Then the random number function chooses a number
  79. between 1 and 48, again storing the element in that ARRAY
  80. POSITION (not the number itself).  Here is an example using
  81. a LOTTO with numbers 1 through 9.  Remeber that arrays in 'C'
  82. start with element zero.
  83.  
  84. array:  1  2  3  4  5  6  7  8  9
  85. selecting elements between 0-8,
  86. random selects 1 which contains the number 2
  87.  
  88. array:  1  3  4  5  6  7  8  9
  89. selecting elements between 0-7,
  90. random selects 7 which contains the number 9
  91.  
  92. array:  1  3  4  5  6  7  8
  93. selecting elements between 0-6,
  94. random selects 4 which contains the number 6
  95.  
  96. array:  1  3  4  5  7  8
  97. selecting elements between 0-5,
  98. random selects 4 which contains the number 7
  99.  
  100. array:  1  3  4  5  8
  101. selecting elements between 0-4,
  102. random selects 0 which contains the number 1
  103.  
  104. array:  3  4  5  8
  105. selecting elements between 0-3,
  106. random selects 1 which contains the number 4
  107.  
  108. number sequence selected:  2 - 9 - 6 - 7 - 1 - 4
  109.  
  110. As you can see, this program generates numbers purely on
  111. chance, which is theoretically how the real LOTTO works.
  112. Soon I will be releasing a LOTTO II program which will
  113. use previous LOTTO numbers to generate a new number sequence.
  114. This is based on a simple statistical theory:
  115.  
  116.   According to the law of probabilities, even if a flipped coin
  117.   has come up HEADS the past nine times, the probability of the
  118.   coin coming up heads again on the next flip is still exactly 50%!
  119.   This program uses this theory.
  120.  
  121.   But, according to the law of averages, the probability of getting
  122.   ten HEADS in a row is only 1 in 1024 or about 0.01%.  LOTTO II
  123.   will use this theory.
  124.  
  125. ---------------------------------------------------------------------
  126.  
  127. PROGRAM NOTE
  128.  
  129. The "cycling" black numbers are for effect only and may be eliminated
  130. if you are impatient.  All six numbers are generated before the
  131. display_numbers() function is even called and the cycling begins.
  132.  
  133. exit...
  134.