Re: Actual Lottery Stuff. WOW eh?
- From: "Abraxas" <dontbother@xxxxxxxxxx>
- Date: Fri, 28 Jul 2006 13:34:12 -0400
"Michael Harrington" <mikharr@xxxxxxxxxxx> wrote in message
news:44c9d5e2$0$23677$5a62ac22@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Near as I can figger...there's no easy way to do that. Nobody said it was
easy. Let me know when you've successfully generated 9.8 million unique
quick picks and I'll run them through my handy cipherin' sorter thingie
that
I keep handy for just such a purpose.
Here is a Visual Basic routine to generate as many unique quick
picks as you like. This prints the first 37 to screen but you can
do the whole lot if you have time. Let me know if you need a
routine to generate the actual tickets from their index number.
Cheers Mick.
Private Sub Command1_Click()
Dim Barrel(1 To 13983816) As Long, i As Long
Dim j As Long, pick As Long, drawn As Long
For i = 1 To 13983816
Barrel(i) = i
Next i
For j = 13983816 To 13983780 Step -1 ' we can lower this as desired
drawn = Int(Rnd * j) + 1
pick = Barrel(drawn)
Barrel(drawn) = Barrel(j)
Barrel(j) = pick
Print pick
Next j
End Sub
Thanks Michael. That's an interesting algorithm that I'll try out. I have a
routine that will generate any desired quantity of random 6 number
combinations and save them to a text file. It's pretty quick at pumping out
several thousand or even hundreds of thousands. I just don't have the
patience to wait for almost 10 million. Even on a fast machine, it takes a
considersble amount of time to reach even 1 million. Also, it inevitably
produces duplicate lines at some point and they're pretty difficult to track
down. I've thought of using index numbers as you suggest, but it still
concerns me that duplicates would happen. There are ways to check for
duplicates, but that would slow the process to a crawl and render it pretty
much impractical for such huge amounts of lines.
Thanks for your input.
Regards, Paul
--
Posted via a free Usenet account from http://www.teranews.com
.
- Follow-Ups:
- Re: Actual Lottery Stuff. WOW eh?
- From: Michael Harrington
- Re: Actual Lottery Stuff. WOW eh?
- References:
- Actual Lottery Stuff. WOW eh?
- From: Abraxas
- Re: Actual Lottery Stuff. WOW eh?
- From: Gerry
- Re: Actual Lottery Stuff. WOW eh?
- From: Abraxas
- Re: Actual Lottery Stuff. WOW eh?
- From: Michael Harrington
- Actual Lottery Stuff. WOW eh?
- Prev by Date: Re: Actual Lottery Stuff. WOW eh?
- Next by Date: Re: Handy Reminders
- Previous by thread: Re: Actual Lottery Stuff. WOW eh?
- Next by thread: Re: Actual Lottery Stuff. WOW eh?
- Index(es):