Indiana United States
Member #48,723
January 7, 2007
1,961 Posts
Offline
I decided to make a very basic Quick Pick generator for PowerBall. It first asks how many you would like to print, picks 5 random numbers between 1 and 55(the white balls) and a random number between 1 and 42(the PowerBall). It then puts each of the white balls into numerical order and displays the results. If you want the results to be saved to a file called QuickPicks.txt, change the line that has:
//PrintToFile(); // Uncomment to print the results to QuickPicks.txt
to
PrintToFile(); // Uncomment to print the results to QuickPicks.txt
If you want this to work with Mega Millions, change the 55's to 56's and change the 42 to 46.
Mcminnville, Oregon United States
Member #3,013
December 13, 2003
6,173 Posts
Offline
Lottery Post has a Quick Picks Generator in the left hand margin under the title "Quick Picks" for several game including Mega Millions and Powerball. I thought I would let you know.-weshar75
A long and winding road United States
Member #17,083
June 10, 2005
6,680 Posts
Offline
Thank you Guru for your contribution to Lottery post. We can each learn to appreciate a little more the efforts some folks make in helping or contributing with different programs.
Indiana United States
Member #48,723
January 7, 2007
1,961 Posts
Offline
Quote: Originally posted by TheGameGrl on Jan 19, 2007
Thank you Guru for your contribution to Lottery post. We can each learn to appreciate a little more the efforts some folks make in helping or contributing with different programs.
No problem. The real reason why I posted the code is because a quick pick generator is indeed the most basic type of lottery number generator there is, however, modifications can be made to increase your odds of winning a prize in the lottery. Now, I'm not going to just post every single one of the algorithms that I use in my own version right away because I want this to be a learning experience for the people who are interested in coming up with their own algorithms. There are literally hundreds of ways to increase your odds of winning a prize in the lottery. Of course how often you win and how much you win depends on your strategies.
United States
Member #9,579
December 12, 2004
2,121 Posts
Offline
i don't care if it's in the millions,i want a qp generator that shows us all possible combinations.then each drawing we could just check off a numerically posted sequence.like the lottery has!
Indiana United States
Member #48,723
January 7, 2007
1,961 Posts
Offline
Quote: Originally posted by scorpio on Jan 19, 2007
i don't care if it's in the millions,i want a qp generator that shows us all possible combinations.then each drawing we could just check off a numerically posted sequence.like the lottery has!
This will create a file that has all the combinations in it:
Keep in mind if you run this, it will take a VERY VERY VERY long time to complete, so it's best that you close other running programs before running it. Also keep in mind that it could take 30 minutes or more(depending on the speed of your computer) just to open this file in notepad because the file will be 1.4GB in size!!!!!! I suggest not using other programs while the file is being opened.
United States
Member #10,720
January 23, 2005
935 Posts
Offline
Nice programs. I write C# which is similar. My program runs in Windows. One part of the program has an RNG option mainly to use for computerized drawings if/when I play those. Question: Does the RNG generator make sure that a number is not put twice (other than Bonus Ball)? I don't recommend using a list 1.4gb in size, that eats so much disk space! A twist on the marking off of used numbers: use your favorite RNG method and pick 5 numbers and a BB, then flag off the 5 numbers (and a separate BB list) and keep going until they run out (all #s flagged) at that point unflag all #s if you want to keep generating more. THIS IS SIMILAR TO THE METHOD A GROUP OF SCIENTISTS USED (in England or Australia I think) AND WON 8 MILLION DOLLARS (except they used pieces of paper). If you want a Windows prg. for this I can make one in minutes. In fact I might make this prg. very soon and give you a link to it. Also question, the RNG that's on here, do you need Double Secret Premium Access to use it? Or anyone can?
Keep in mind if you run this, it will take a VERY VERY VERY long time to complete, so it's best that you close other running programs before running it. Also keep in mind that it could take 30 minutes or more(depending on the speed of your computer) just to open this file in notepad because the file will be 1.4GB in size!!!!!! I suggest not using other programs while the file is being opened.
Nice Program!
Although I think it would be interesting to have several data sets.
1. Data Set consisting of all possible combinations without the bonus ball. 2. Data Set consisting of all possible combinations without the bonus ball and without three consecutive numbers. (Ex. 1,2,3) 3. Data Set consisting of all possible combinations without the bonus ball and without four consecutive numbers. (Ex. 1,2,3,4) 4. Data Set consisting of all possible combinations without the bonus ball and without five consecutive numbers. (Ex. 1,2,3,4,5)
Then using your random number generator, have the program select which data set you want to use and generate a random number based on that data set.
Texas United States
Member #33,718
February 24, 2006
764 Posts
Offline
Keep in mind if you run this, it will take a VERY VERY VERY long time to complete, so it's best that you close other running programs before running it. Also keep in mind that it could take 30 minutes or more(depending on the speed of your computer) just to open this file in notepad because the file will be 1.4GB in size!!!!!! I suggest not using other programs while the file is being opened.
Indiana United States
Member #48,723
January 7, 2007
1,961 Posts
Offline
Quote: Originally posted by LckyLary on Jan 19, 2007
Nice programs. I write C# which is similar. My program runs in Windows. One part of the program has an RNG option mainly to use for computerized drawings if/when I play those. Question: Does the RNG generator make sure that a number is not put twice (other than Bonus Ball)? I don't recommend using a list 1.4gb in size, that eats so much disk space! A twist on the marking off of used numbers: use your favorite RNG method and pick 5 numbers and a BB, then flag off the 5 numbers (and a separate BB list) and keep going until they run out (all #s flagged) at that point unflag all #s if you want to keep generating more. THIS IS SIMILAR TO THE METHOD A GROUP OF SCIENTISTS USED (in England or Australia I think) AND WON 8 MILLION DOLLARS (except they used pieces of paper). If you want a Windows prg. for this I can make one in minutes. In fact I might make this prg. very soon and give you a link to it. Also question, the RNG that's on here, do you need Double Secret Premium Access to use it? Or anyone can?
Sorry it took so long to respond. The program does make sure that duplicate numbers are not used. If you use an editor to open large files like LottoL said instead of notepad, then it will open the file MANY times faster. Notepad is very slow at opening files of that size. I opened it using Visual C++ and it opens it a whole lot faster. Find a decent editor and you should be good to go. To run the code above, all you need is a C++ compiler. Dev C++ is a free C++ compiler. Just google for it.
Indiana United States
Member #48,723
January 7, 2007
1,961 Posts
Offline
Quote: Originally posted by LottoL on Jan 20, 2007
Nice Program!
Although I think it would be interesting to have several data sets.
1. Data Set consisting of all possible combinations without the bonus ball. 2. Data Set consisting of all possible combinations without the bonus ball and without three consecutive numbers. (Ex. 1,2,3) 3. Data Set consisting of all possible combinations without the bonus ball and without four consecutive numbers. (Ex. 1,2,3,4) 4. Data Set consisting of all possible combinations without the bonus ball and without five consecutive numbers. (Ex. 1,2,3,4,5)
Then using your random number generator, have the program select which data set you want to use and generate a random number based on that data set.
Best Of Luck,
LottoL
Ok, I went ahead and made a different version to create a data set by those conditions.
*************************************
To meet condition 1, the if statement should be: if(true)
To meet condition 2, the if statement should be: if(!Is123())
^^^Condition 2 is the version that I have posted below^^^
To meet condition 3, the if statement should be: if(!Is1234())
To meet condition 4, the if statement should be: if(!Is12345())
Keep in mind that if you want to keep a version of each file, make sure you make a copy of DataSets.txt with a different name(such as DataSets123.txt) because DataSets.txt is overwritten each time you run the program.
for(;;) { cout << "How many Quick Picks would you like to print(0 to quit)? "; cin >> count; cout << endl; if(count) { for(int i = 1; i <= count; i++) { do { PickNumbers(); SortNumbers(); }while(Is123()); //PrintToFile(); // Uncomment to print the results to QuickPicks.txt
Indiana United States
Member #48,723
January 7, 2007
1,961 Posts
Offline
I would like to state that the elimination of 3 consecutive numbers in your picks is a gimme strategy when picking numbers playing the lottery. For the PowerBall:
Elimination of all sets that have 3 consecutive numbers when taking ONLY the five white balls into consideration covers 1.94396798% of the possible combinations(ignoring the PowerBall).
Elimination of all sets that have 3 consecutive numbers when taking the five white balls AND the PowerBall into consideration covers 0.0462849519% of the possible combinations(including the PowerBall).
Texas United States
Member #33,718
February 24, 2006
764 Posts
Offline
Quote: Originally posted by Guru101 on Jan 20, 2007
I would like to state that the elimination of 3 consecutive numbers in your picks is a gimme strategy when picking numbers playing the lottery. For the PowerBall:
Elimination of all sets that have 3 consecutive numbers when taking ONLY the five white balls into consideration covers 1.94396798% of the possible combinations(ignoring the PowerBall).
Elimination of all sets that have 3 consecutive numbers when taking the five white balls AND the PowerBall into consideration covers 0.0462849519% of the possible combinations(including the PowerBall).
So you do increase your odds, but not by much.
Thanks Guru101. I sincerely appreciate your response!
I'll have to download the compiler and check out your programs whenever I get some free time.