Numbered List Of Wheeled Power Ball Numbers

BlitzMax Forums/BlitzMax Beginners Area/Numbered List Of Wheeled Power Ball Numbers

JoshPo(Posted 2013) [#1]
Some of you might be interested in how to create your own lottery numbers wheel and count how many numbers are output by the wheel.
This example is for Power Ball but can easily be scaled to create any lottery pick 5 or 6 game.

'Power Ball: pick 5 of 59 and 1 of 35
'A numbered wheel with random Power Ball number pick

For a = 1 To 14 'Parameters for numbers wheeled in first position
For b = 17 To 29 '2nd number ... and so on
For c = 26 To 40
For d = 38 To 53
For e = 50 To 59
For f = -1 To -1 'This is needed to prevent the last numbers from repeating. I don't know why.


If a >= b Goto Here 'Prevents numbers in all positions from repeating
If b >= c Goto Here
If c >= d Goto Here
If d >= e Goto Here

i:+1 'Numbered list counts by 1 using this short snippet
Next

Print i + ":" + a + " " + b + " " + c + " " + d + " " + e + " " 'Print command first 5 numbers
z = Rand(6, 26) 'z is a random number from 12 to 44 'Random number parameters
Print "Power Ball: " + z 'Prints random Power Ball number
Print " "
#Here
Next
Next
Next
Next
Next


Midimaster(Posted 2013) [#2]
I think this algo is complete nonsense...

If you want to select 5 balls from 59 you have to use a Rand(1,59) for each of them. In a second step you have to take care about, that there are no copies.

super simple code:

SuperStrict

Global Result%[6]
Global Number%, Sucess%

For Local i%=1 To 6
	Repeat
		Sucess=True
		Number= Rand(1,59)
		For Local j%=1 To 6
			If Number=Result[j] 
				Sucess=False
			EndIf
		Next
	Until Sucess=True
	Result[i]=Number
	Print "Ball " + i + " is number " + Result[i]
Next




JoshPo(Posted 2013) [#3]
We do not want random numbers, that's the whole point. You can buy random numbers at the store. This is a wheel which produces winners while random numbers are complete nonsense producing nothing.
Also, your program will not run, but if it did run it would produce the same 'random' numbers every time it ran. That is not the definition of 'random'.


Who was John Galt?(Posted 2013) [#4]
This is a wheel which produces winners while random numbers are complete nonsense producing nothing.
LoL! Legendary skillz! Someone's finally cracked the Lotto predictor! I'm handing in my notice tomorrow!

http://www.youtube.com/watch?v=UJOjTNuuEVw


Midimaster(Posted 2013) [#5]
My code is running! Ok, there is no 'game window', but the results are visible in the BlitzMax Ide Output!

The reason, why the RND() in my code always produces the same row of number, is because the SeedRnd() command is missing in this sample.

Add a...
...
SeedRnd MilliSecs()
For Local i%=1 To 6
...

..and it will produce real random numbers



Maybe I did not understand, what you want to do with your code. But it has nothing to do with lotto, etc...



As I see your system cannot produce a result row like " 3, 9, 15, ...."?!? But in reality it can happen of course, or not?

Do you really believe, that a "3" never can come together with a "9"?!?

And your system is not able to produces a "15". Is there no ball with a "15" in lotto? Sorry, I think your article is not serious, are you kidding?


JoshPo(Posted 2013) [#6]
The parameters in positions a-f obviously can be adjusted to any configuration to include 3, 9, 15 if you so desire. They are not chiseled in stone.
This will not 'predict' the lottery but will produce results based on best guess or average numbers or whatever criteria you apply, in any position.
It is a wheel, not a 'lottery predictor'. Not magic, never said it was.
If you can't see the value of it go find someone else to haunt.

To set the wheel to print every combination use:
a = 1 to 54
b = 2 to 55
c = 3 to 56
d = 4 to 57
e = 5 to 58
f = 6 to 59

Simple, right? And produces millions of combinations.
And I think your criticism is not serious, or helpful, merely a hatchet job.
Like being in Junior High School again ...


Midimaster(Posted 2013) [#7]
Sorry if I sounded harsh. I did not want to offend you.

Simply did not understand, what it is good for....


GfK(Posted 2013) [#8]
This is a wheel which produces winners while random numbers are complete nonsense producing nothing.
I was writing these things almost twenty years ago. Guess what? They don't work. There is absolutely no method at all for predicting lottery results. It is impossible.

Have fun coding, but that's all you'll get out of it.


JoshPo(Posted 2013) [#9]
Guess what, I was writing them 30 years ago on my Commodore. I am just getting back into Basic by doing what I learned then. I actually had a wheel of about 5,000 sets that did work at the time. But who has $5,000 for lotto?

Plus, over the years the lottery games have become much larger and their parimutuel payouts are far from equitable.

So, all I am doing is learning code again. Things have changed a lot on Basic and there are multiple Basic methods to choose from. It was a struggle to get this to work at all and if others are doing similar things they might want to see how I addressed it because there is not a lot of info out there.

It is just a game. And I am having fun coding. That is what it is good for.


Brucey(Posted 2013) [#10]
I think the idea is that you pick a set of say, 22 numbers, and create an array of variations of those numbers for each line. Then you get like a 90% chance of winning something if, for example, 4 of those 22 numbers come up. (because those 4 numbers would appear together in at least one line)

Obviously it doesn't help you to win the jackpot - well... 1, 2, 3, 4, 5, 6 has as much chance of winning that as anything.

btw, your code would be easier to read if you wrapped it in {code} {/code} tags (replace curly with square brackets - there's also a (forum codes) link above the post text field on the page for all your posting needs.)


JoshPo(Posted 2013) [#11]
Thanks Brucey. I am just learning this stuff and have quite a way to go.