Full wheel source code

LuckySam

Member
For your programming pleasure...

I'm posting source code for generating full wheels, any number per game, any number to wheel (>= number per game). You can download it from http://www.doublemania.com/lotto649/fullwheel.zip

This is going to be part of some home-brew software I'm making. I'm still wrestling with other issues, including how to smartly pick rows from the wheel that give uniform coverage of all numbers wheeled. Please see my earlier post in forum Lottery Wheels, and reply on that thread if you have an algorithm for that.

You may feel free to use the source I'm posting now, any way you wish. You'll see it includes two C++ classes:
1) CGame, which contains the picks for one row in the wheel, and
2) CWheel, which fills and contains the CGame objects.
CWheel starts by computing the total combos, given number per game and number to wheel. Then it iterates through these one at a time, and (recursively) generates each new game. It's designed to run in a worker thread that notifies the main (GUI) thread every so often, so on-screen status can be updated as the wheel is generated. I have tested it quite a bit, and I'm certain it works correctly. :agree:

Enjoy! Let me know if you have a smarter way to fill the games in the full wheel. And if you have a good way to select for uniform coverage from the full wheel, please reply to my earlier post in the Lottery Wheels forum.

Sam
 

LuckySam

Member
turn to exe

I extracted this from some code I'm writing in visual C++ 6.0. I actually have two versions.

In the simpler test code, the whole app is dialog based, and the wheel.fill() gets called after you fill in numbers per game and number to wheel. It kicks off the filling thread, which sends messages back to -- in this case -- the dialog itself, because the dialog calls with its "this" pointer as the pointer to the view.

The bigger app I'm writing uses a document-view approach. The document owns the wheel and tells it to fill. The document passes a pointer to it's associated view to fill(), and the view gets messages until the full wheel is filled up.

I hope that helps. If not, there are nuggets in there you can copy-and-paste into other code. Just be aware that if you attempt to run a case with a very large full wheel, it can take a LONG time and LOTS of memory. That's why I opted to have a separate thread to do the filling, and have it send progress messages along the way.

Yes, I know, C++ is ancient history, but I'm a dinosaur, too old to have learned Java or anything newer in school, too well paid writing C++ to care. :)

Sam

P.S. I would love to give you the full code for the test program, but unfortunately I'm still learning how to make the GUI stuff work -- that's not my forte. So, while I know the results in memory are good, I can't produce an app yet that will display the full wheel. Maybe when I get that figured out I'll post a complete test version.
 

PAB

Member
Hi Sam,

I am interested in looking at the source code for generating full wheels but I am unable to find it in the link you have posted.

Thanks in Advance.
All the Best.
PAB
:wavey:
 

bloubul

Member
Hi PAB

All the best for 2008. Are you only looking for the code, I can upload Lotto Genius Full Wheel Generator for you. Let me know.

BlouBul :cool:
 

PAB

Member
Hi BlouBul,

A VERY Happy New Year to you.
Yes, I would like the source code if possible please.

Thanks in Advance.
All the Best.
PAB
:wavey:
 

bloubul

Member
Hi PAB

It is not the source code, it is the complete exe. generator, what must I do????? If you know how to get the source code its up to you.

BlouBul :cool:
 

bloubul

Member
PAB said:
Hi Sam,

I am interested in looking at the source code for generating full wheels but I am unable to find it in the link you have posted.

Thanks in Advance.
All the Best.
PAB
:wavey:

Hi PAB

All the best for 2008.
Where can I upload Full Wheel Generator for you as www.mytemdir.com is full of problems????????
I don't know how you will extract the source code but it is up to you.

BlouBul :cool:
 

Sidebar

Top