home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
fish
/
applications
/
lotto
/
readme
< prev
next >
Wrap
Text File
|
1991-01-11
|
5KB
|
134 lines
FLORIDA LOTTO PROGRAM v1.0
© Copyright 1988 Timm Martin
All Rights Reserved
This program may be distributed freely as long as
this notice remains intact. This program may not
be sold individually or as part of a group without
the express written consent of the author.
This program is for entertainment only and is sold
without any express or implied warranties whatsoever.
The user must assume the entire risk of using the
program (hey, you don't need my help to lose your
money). Any liability of the author will be limited
to a refund of the purchase price (which is nothing).
Send all compliments, complaints, and monetary
expressions of gratitude to:
Timm Martin
11325 94th Street North
Largo, FL 34643
My only request is that if you win BIG using this
program, please mention to everyone that you used
this program to generate your winning numbers.
---------------------------------------------------------------------
CONTENTS OF THIS PACKAGE:
program - executable LOTTO program
program.c - 'C' source code to the LOTTO program
program.info - icon for the LOTTO program (check it out)
README - what you are reading now
---------------------------------------------------------------------
TO EXECUTE THIS PROGRAM:
To execute this program, either double click on the icon
or type "program" (without the quotes) from the CLI.
You will notice a long red box and two gadgets in a purple
screen. Click on the left gadget to display in the red
box six LOTTO numbers between 1 and 49. To quit the
program, click on the right gadget. Since the screen's
depth gadgets are hidden by this program, just press
LEFT-AMIGA-N and LEFT-AMIGA-M (or COMMODORE-N and M if you
have an Amiga 500 or 2000) to toggle back and forth between
this and the Workbench screen.
---------------------------------------------------------------------
TO COMPILE THIS PROGRAM:
At the CLI, just type:
cc program.c
ln program.o -lc
This is set up for Manx users. Sorry, Lattice users, you're
on your own. The program compiles without any warnings using
Manx v3.6a. If you have an earlier version of the compiler,
remove the compiler directive line that says:
#include <intuition/screens.h>
---------------------------------------------------------------------
HOW THE LOTTO NUMBERS ARE GENERATED:
There are many possible ways to generate six LOTTO numbers
between 1 and 49, so I chose what I believe to be the most
straightforward method. I create an array containing in
ascending order the 49 integers between 1 and 49, then ask
a random number function to choose one of the elements.
The number in that element is stored and removed from the
array. Then the random number function chooses a number
between 1 and 48, again storing the element in that ARRAY
POSITION (not the number itself). Here is an example using
a LOTTO with numbers 1 through 9. Remeber that arrays in 'C'
start with element zero.
array: 1 2 3 4 5 6 7 8 9
selecting elements between 0-8,
random selects 1 which contains the number 2
array: 1 3 4 5 6 7 8 9
selecting elements between 0-7,
random selects 7 which contains the number 9
array: 1 3 4 5 6 7 8
selecting elements between 0-6,
random selects 4 which contains the number 6
array: 1 3 4 5 7 8
selecting elements between 0-5,
random selects 4 which contains the number 7
array: 1 3 4 5 8
selecting elements between 0-4,
random selects 0 which contains the number 1
array: 3 4 5 8
selecting elements between 0-3,
random selects 1 which contains the number 4
number sequence selected: 2 - 9 - 6 - 7 - 1 - 4
As you can see, this program generates numbers purely on
chance, which is theoretically how the real LOTTO works.
Soon I will be releasing a LOTTO II program which will
use previous LOTTO numbers to generate a new number sequence.
This is based on a simple statistical theory:
According to the law of probabilities, even if a flipped coin
has come up HEADS the past nine times, the probability of the
coin coming up heads again on the next flip is still exactly 50%!
This program uses this theory.
But, according to the law of averages, the probability of getting
ten HEADS in a row is only 1 in 1024 or about 0.01%. LOTTO II
will use this theory.
---------------------------------------------------------------------
PROGRAM NOTE
The "cycling" black numbers are for effect only and may be eliminated
if you are impatient. All six numbers are generated before the
display_numbers() function is even called and the cycling begins.
exit...