# Random Numbers - No Repeat

### Question

• Hi there

I have basic swap program that generates random numbers with no repeat from 0 to 820

but its not random enough.

I have a schedule program that creates 82 games for 20 teams and then i was going to randomally assign a game number to each game thus creating a league schedule.

but it has a few of the same teams playing there games in the first set of games.

is there a way to do another swap or a better random number generator.

here is my code

Dim intArr(819) As Integer

Dim strBuff As String

Dim intIdx As Integer, intRnd As Integer, intBuff As Integer, intUppBound As Integer

intUppBound = UBound(intArr)

' Load the Number Array with 820 numbers

For intIdx = 0 To intUppBound

intArr(intIdx) = intIdx + 1

Next

Randomize() ' Randomly swap Array values (some swaps may be repeated)

For intIdx = 0 To intUppBound

'Int((upperbound - lowerbound + 1) * Rnd + lowerbound)

intRnd = Int((intUppBound - 0 + 1) * Rnd() + 0)

intBuff = intArr(intIdx)

intArr(intIdx) = intArr(intRnd)

intArr(intRnd) = intBuff

Next

thanks

nick

Wednesday, January 28, 2009 12:00 AM

• Guids are extremely random

Dim newGuid As Guid

Then just do this:

 Private Function GetRandom() As String newGuid = Guid.NewGuid Return newGuid.ToString() End Function

John Grove - TFD Group, Senior Software Engineer, EI Division, http://www.tfdg.com
Wednesday, January 28, 2009 12:26 AM

### All replies

• You can create a Guid.

John Grove - TFD Group, Senior Software Engineer, EI Division, http://www.tfdg.com
Wednesday, January 28, 2009 12:19 AM
• how would i create a guid

Wednesday, January 28, 2009 12:24 AM
• Guids are extremely random

Dim newGuid As Guid

Then just do this:

 Private Function GetRandom() As String newGuid = Guid.NewGuid Return newGuid.ToString() End Function

John Grove - TFD Group, Senior Software Engineer, EI Division, http://www.tfdg.com
Wednesday, January 28, 2009 12:26 AM
• is there an upper bound and lower bound for this and how would i add these numbers to an array

do i call this everytime i need a number

Wednesday, January 28, 2009 12:34 AM
• i figured it out thanks

it just creates a bunch of letters and numbers - i had to change my datagrid to have strings/text and it worked pretty good.

Wednesday, January 28, 2009 12:50 AM
• Well I'm lost how does that create a league schedule ?
Wednesday, January 28, 2009 12:53 AM
• well i made a schedule team by team adding conference games, divisional games and cross conference games all to a list box in order and then created a schedule array home and away.  to randomimize the order of games - considering that they were added team by team - i need to find a way to random sort games so that each team doesn't play there 82 games in a row.

Wednesday, January 28, 2009 1:00 AM
• I meant how does a GUID create a league schedule .
Wednesday, January 28, 2009 1:04 AM
• guid creates extremely random strings (i.e. numbers and letters) - i used guid to randomally sort my league schedule
Wednesday, January 28, 2009 1:06 AM
• Your random generator is probably working as it should,  even so, there is no procedure in place to assure that the values generated don't at some point match.

I seem to recall these sort of programs being called "Lotteries".

If you think about it that way, then you realize that you have check the numbers being generated to ensure that they're not being duplicated.

An If  or IF  ElseIf  statement would work.

For Number = 0 to 820

{ insert code to pick random numbers }

'  Check to unsure they are unique

If value1  = value2 then
Start over until all numbers are unique or in an acceptable range
ElseIf value1 = value3 then
Ditto
else
The numbers were all random and none matched
The schedule will work
print schedule
end if

Next Number
Thursday, February 12, 2009 1:45 AM
• Here's what I did.

I set up three arrays 1 to Max.  Then picked a random number between 1 and 50, another between 1 and 10, and another very often between one and three.

Basically, it's like shuffling cards.  One array represents the deck.  The First Random number is between 1 and 50, which is how many times to go through the next sequence of events.

When I cut the cards/array a human is normally off by maybe 5+ or 5-.  That's a random number between 1 and 10 added to 21, because there's 52 cards in a deck.  One set of cards goes in order into the RightHand Array, the other which is the LeftHand Array + the random number of cards added to the 21 cut.  Then every time I take from either the RightHand, or LeftHand array I draw a random number between 1 and 3, and put that many cards back into the Deck array from the LeftHand, then the RightHand Array, alternately.  I never take the same number of cards and always draw a new random number between 1 and 3 to move that many cards into the Deck Array.  If there are more cards left in one array than the other, they are simply placed at the bottom of the deck because, when they are shuffled, it's always bottom first.

As a rule, the computer is so fast, shuffling the cards 50 times doesn't take as long as a human does shuffling the deck once.

Then I don't wind up with duplicate numbers being drawn and wind up with the odds totally against me to see all of the numbers in a bin selected.  The problem with a straight random number generator is that it doesn't draw 1-820, without drawing some numbers a large number of times before getting to the last one.  The odds wind up similar to 820^2 of ever seeing the last number or any one particular number.  The odds of seeing any one number any and every time you draw a random number is typically stuck at 1 in 820.  So, waiting for the last number or any one specific number may never happen.

You can modify a bubble sort by taking a random stab at an array, then move all of the values up or down pending on whether the gap you generate taking a value out and putting into a string above or below the center line.  That takes only one array and two strings.  One to hold the value you are moving, and the other to move all of the values down or up to the center line.
• Proposed as answer by Thursday, February 12, 2009 2:04 AM
• Edited by Thursday, February 12, 2009 2:23 AM details
Thursday, February 12, 2009 2:04 AM
• Have a read of: Coding Horror: Shuffling

(1) - Add the items to a list. Pluck items out randomly. Here it uses a cryptographically strong random number generator to generate a seed for the standard Random class:

 Imports System.Security.Cryptography Public Class Form1 Private tb As New TextBox With {.Dock = DockStyle.Fill, .Multiline = True, _ .ScrollBars = ScrollBars.Vertical, _ .Font = New Font("Courier New", 8)} Private rand As Random Private draw() As Integer Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Me.Controls.Add(tb) ' We want a random seed for the instance of the Random class. Dim rng As New RNGCryptoServiceProvider Dim seedBytes(3) As Byte rng.GetBytes(seedBytes) Dim seed As Integer = BitConverter.ToInt32(seedBytes, 0) rand = New Random(seed) DrawGames() Display() Me.Size = New Size(800, 600) End Sub Public Sub DrawGames() ' Put all the numbers in a pool Dim pool As New List(Of Integer) For i As Integer = 1 To 820 pool.Add(i) Next ' Draw them from the pool into another collection. draw = New Integer(819) {} For i As Integer = 0 To 819 ' We use the random class because it is very convenient: Dim randomIndex As Integer = rand.Next(0, pool.Count) ' 0 <= randomIndex < pool.Count draw(i) = pool(randomIndex) pool.RemoveAt(randomIndex) Next End Sub Public Sub Display() Dim sb As New System.Text.StringBuilder For i As Integer = 0 To draw.Count - 1 sb.Append(draw(i).ToString.PadLeft(4, " "c)) If i Mod 20 = 19 Then sb.AppendLine() End If Next tb.Text = sb.ToString End Sub End Class

(2) or, some of the new language features. Here it orders the numbers 1 to 820 using a new guid, as mentioned somewhere above. Just 3 lines of code to get a shuffled list(Of integer)!

 Option Infer On Public Class Form1 Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click Dim teams As List(Of Integer) = GetDraw() Dim sb As New System.Text.StringBuilder For i As Integer = 0 To teams.Count - 1 sb.Append(teams(i).ToString.PadLeft(4, " "c)) If i Mod 20 = 19 Then sb.AppendLine() Next Dim f As New Form With {.Size = New Size(800, 600)} Dim tb As New TextBox With {.Dock = DockStyle.Fill, .Multiline = True, .ScrollBars = ScrollBars.Vertical, _ .Text = sb.ToString, .ReadOnly = True, .Font = New Font("Courier New", 8)} f.Controls.Add(tb) f.ShowDialog() End Sub Private Function GetDraw() As List(Of Integer) Dim teams = Enumerable.Range(1, 820) teams = teams.OrderBy(Function(x) Guid.NewGuid) Return New List(Of Integer)(teams) End Function End Class

(3) I'm not sure about the Random Guid thing, there were concerns about this in the comments of the codinghorror site I linked to. This one uses the Cryptographic random number generator to generate doubles and orders the items by that, as recommended on that site.

 Option Infer On Imports System.Security.Cryptography Public Class Form1 Private rng As New RNGCryptoServiceProvider Private WithEvents tb As New TextBox With {.Dock = DockStyle.Fill, .Multiline = True, _ .ScrollBars = ScrollBars.Vertical, _ .ReadOnly = True, .Font = New Font("Courier New", 8)} Sub New() InitializeComponent() Me.Controls.Add(tb) Me.Size = New Size(700, 750) Me.Text = "Click the textbox." End Sub Private Sub tb_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles tb.Click Dim teams As List(Of Integer) = GetDraw() Dim sb As New System.Text.StringBuilder For i As Integer = 0 To teams.Count - 1 sb.Append(teams(i).ToString.PadLeft(4, " "c)) If i Mod 20 = 19 Then sb.AppendLine() Next tb.Text = sb.ToString End Sub Private Function GetDraw() As List(Of Integer) ' Create an enumerable collection of integers storing 1 to 820 Dim teams = Enumerable.Range(1, 820) ' Sort it by random doubles. teams = teams.OrderBy(Function(x) RandomDouble(x)) ' Convert it into List as that is a bit friendlier. Return New List(Of Integer)(teams) End Function ' This returns a function that creates a random double. The Integer bit is just ignored. Private Function RandomDouble() As Func(Of Integer, Double) ' 8 bytes for the double. Dim bytes(7) As Byte ' Get cryptographically strong random bytes into the array. rng.GetBytes(bytes) ' The function uses the bytes to create a double. x is ignored. Dim getDouble = Function(x As Integer) BitConverter.ToDouble(bytes, 0) Return getDouble End Function End Class

Thursday, February 12, 2009 4:18 AM
•   Here's some javascript I used;

<TITLE>Lottery Program</TITLE>

<script language = javascript>
var drawcounter = 0
var cost = 0
var winnings = 0
counter = new Array(5)
nineth = new Array(5)
tenth = new Array(5)
eleventh = new Array(5)
twelvth = new Array(5)
thirteenth = new Array(5)
fourteenth = new Array(5)
fifteenth = new Array(5)

for (i = 1; i < 6; i++) {
counter[i] = 0
nineth[i] = 0
tenth[i] = 0
eleventh[i] = 0
twelvth[i] = 0
thirteenth[i] = 0
fourteenth[i] = 0
fifteenth[i] = 0
}

function getNumbers() {

var temp = 0
var newnumber = 0
document.frmOne.taAll.value = ""
document.frmOne.taSix.value = ""

lottery = new Array(49)
MyNumbers = new Array(6)
MyNumbers[0] = ""
MyNumbers[1] = document.frmOne.n1.value
MyNumbers[2] = document.frmOne.n2.value
MyNumbers[3] = document.frmOne.n3.value
MyNumbers[4] = document.frmOne.n4.value
MyNumbers[5] = document.frmOne.n5.value
MyNumbers[6] = document.frmOne.n6.value

Second = new Array(6)
Second[1] = document.frmOne.n7.value
Second[2] = document.frmOne.n8.value
Second[3] = document.frmOne.n9.value
Second[4] = document.frmOne.n10.value
Second[5] = document.frmOne.n11.value
Second[6] = document.frmOne.n12.value

Third = new Array(6)
Third[1] = document.frmOne.n13.value
Third[2] = document.frmOne.n14.value
Third[3] = document.frmOne.n15.value
Third[4] = document.frmOne.n16.value
Third[5] = document.frmOne.n17.value
Third[6] = document.frmOne.n18.value

Fourth = new Array(6)
Fourth[1] = document.frmOne.n19.value
Fourth[2] = document.frmOne.n20.value
Fourth[3] = document.frmOne.n21.value
Fourth[4] = document.frmOne.n22.value
Fourth[5] = document.frmOne.n23.value
Fourth[6] = document.frmOne.n24.value

Fifth = new Array(6)
Fifth[1] = document.frmOne.n25.value
Fifth[2] = document.frmOne.n26.value
Fifth[3] = document.frmOne.n27.value
Fifth[4] = document.frmOne.n28.value
Fifth[5] = document.frmOne.n29.value
Fifth[6] = document.frmOne.n30.value

Sixth = new Array(6)
Sixth[1] = document.frmOne.n31.value
Sixth[2] = document.frmOne.n32.value
Sixth[3] = document.frmOne.n33.value
Sixth[4] = document.frmOne.n34.value
Sixth[5] = document.frmOne.n35.value
Sixth[6] = document.frmOne.n36.value

Seventh = new Array(6)
Seventh[1] = document.frmOne.n37.value
Seventh[2] = document.frmOne.n38.value
Seventh[3] = document.frmOne.n39.value
Seventh[4] = document.frmOne.n40.value
Seventh[5] = document.frmOne.n41.value
Seventh[6] = document.frmOne.n42.value

Eighth = new Array(6)
Eighth[1] = document.frmOne.n43.value
Eighth[2] = document.frmOne.n44.value
Eighth[3] = document.frmOne.n45.value
Eighth[4] = document.frmOne.n46.value
Eighth[5] = document.frmOne.n47.value
Eighth[6] = document.frmOne.n48.value

//fill the array with number 1 to 49
for (i = 1; i < 50; i++) {
lottery[i] = i
}
var dumbwaiter = 0

while(dumbwaiter<101) {

//shuffle the numbers around
for (x = 1; x < 50; x++) {
for (i = 1; i < 50; i++) {
newnumber = (Math.random() * 49) + 1
newnumber = parseInt(newnumber, 10)
temp = lottery[i]
lottery[i] = lottery[newnumber]
lottery[newnumber] = temp
}
}

//print all the lottery numbers
if (dumbwaiter == 100) {
for (i = 1; i < 50; i++) {
document.frmOne.taAll.value = document.frmOne.taAll.value + i + "=" + lottery[i] + "\n"
}
}
//print the first six as lottery numbers
var num = 0
var num2 = 0
counter[1] = 0
nineth[1] = 0
tenth[1] = 0
eleventh[1] = 0
twelvth[1] = 0
thirteenth[1] = 0
fourteenth[1] = 0
fifteenth[1] = 0

for (i = 1; i < 7; i++) {
if (dumbwaiter == 100) {
document.frmOne.taSix.value = document.frmOne.taSix.value + lottery[i] + "\n"
}
num = lottery[i]
for (j = 1; j < 7; j++) {
num2 = MyNumbers[j]
if (num2 == num) counter[1]++
if (j == 6 && counter[1] == 6) counter[2]++
if (j == 6 && counter[1] == 5) counter[3]++
if (j == 6 && counter[1] == 4) counter[4]++
if (j == 6 && counter[1] == 3) counter[5]++
}
for (j = 1; j < 7; j++) {
num2 = Second[j]
if (num2 == num) nineth[1]++
if (j == 6 && nineth[1] == 6) nineth[2]++
if (j == 6 && nineth[1] == 5) nineth[3]++
if (j == 6 && nineth[1] == 4) nineth[4]++
if (j == 6 && nineth[1] == 3) nineth[5]++
}
for (j = 1; j < 7; j++) {
num2 = Third[j]
if (num2 == num) tenth[1]++
if (j == 6 && tenth[1] == 6) tenth[2]++
if (j == 6 && tenth[1] == 5) tenth[3]++
if (j == 6 && tenth[1] == 4) tenth[4]++
if (j == 6 && tenth[1] == 3) tenth[5]++
}
for (j = 1; j < 7; j++) {
num2 = Fourth[j]
if (num2 == num) eleventh[1]++
if (j == 6 && eleventh[1] == 6) eleventh[2]++
if (j == 6 && eleventh[1] == 5) eleventh[3]++
if (j == 6 && eleventh[1] == 4) eleventh[4]++
if (j == 6 && eleventh[1] == 3) eleventh[5]++
}
for (j = 1; j < 7; j++) {
num2 = Fifth[j]
if (num2 == num) twelvth[1]++
if (j == 6 && twelvth[1] == 6) twelvth[2]++
if (j == 6 && twelvth[1] == 5) twelvth[3]++
if (j == 6 && twelvth[1] == 4) twelvth[4]++
if (j == 6 && twelvth[1] == 3) twelvth[5]++
}
for (j = 1; j < 7; j++) {
num2 = Sixth[j]
if (num2 == num) thirteenth[1]++
if (j == 6 && thirteenth[1] == 6) thirteenth[2]++
if (j == 6 && thirteenth[1] == 5) thirteenth[3]++
if (j == 6 && thirteenth[1] == 4) thirteenth[4]++
if (j == 6 && thirteenth[1] == 3) thirteenth[5]++
}
for (j = 1; j < 7; j++) {
num2 = Seventh[j]
if (num2 == num) fourteenth[1]++
if (j == 6 && fourteenth[1] == 6) fourteenth[2]++
if (j == 6 && fourteenth[1] == 5) fourteenth[3]++
if (j == 6 && fourteenth[1] == 4) fourteenth[4]++
if (j == 6 && fourteenth[1] == 3) fourteenth[5]++
}
for (j = 1; j < 7; j++) {
num2 = Eighth[j]
if (num2 == num) fifteenth[1]++
if (j == 6 && fifteenth[1] == 6) fifteenth[2]++
if (j == 6 && fifteenth[1] == 5) fifteenth[3]++
if (j == 6 && fifteenth[1] == 4) fifteenth[4]++
if (j == 6 && fifteenth[1] == 3) fifteenth[5]++
}
}
dumbwaiter++
}

drawcounter++

var temp1 = 0
var temp2 = 0
var temp3 = 0
var total = 0

total = drawcounter * 4.487
total = Math.ceil(total);
var bip=' Time Wasted in Dog<BR>Years '+total+' ';
if (fifteenth[2] > 0 || fourteenth[2] > 0 || thirteenth[2] > 0 || twelvth[2] > 0 || eleventh[2] > 0 || tenth[2] > 0 || nineth[2] > 0 || counter[2] > 0) {
bip =" WINNER! "
}
document.getElementById("hp").innerHTML=bip;

temp1 = (fifteenth[5] + fourteenth[5] + thirteenth[5] + twelvth[5] + eleventh[5] + tenth[5] + nineth[5] + counter[5]) * 3

temp2 = (fifteenth[4] + fourteenth[4] + thirteenth[4] + twelvth[4] + eleventh[4] + tenth[4] + nineth[4] + counter[4]) * 30

temp3 = (fifteenth[3] + fourteenth[3] + thirteenth[3] + twelvth[3] + eleventh[3] + tenth[3] + nineth[3] + counter[3]) * 1000

winnings = temp1 + temp2 + temp3

cost = (drawcounter * 400) - winnings

document.frmOne.win1.value = counter[2]
document.frmOne.win2.value = counter[3]
document.frmOne.win3.value = counter[4]
document.frmOne.win4.value = counter[5]

document.frmOne.win5.value = nineth[2]
document.frmOne.win6.value = nineth[3]
document.frmOne.win7.value = nineth[4]
document.frmOne.win8.value = nineth[5]

document.frmOne.win9.value = tenth[2]
document.frmOne.win10.value = tenth[3]
document.frmOne.win11.value = tenth[4]
document.frmOne.win12.value = tenth[5]

document.frmOne.win13.value = eleventh[2]
document.frmOne.win14.value = eleventh[3]
document.frmOne.win15.value = eleventh[4]
document.frmOne.win16.value = eleventh[5]

document.frmOne.win17.value = twelvth[2]
document.frmOne.win18.value = twelvth[3]
document.frmOne.win19.value = twelvth[4]
document.frmOne.win20.value = twelvth[5]

document.frmOne.win21.value = thirteenth[2]
document.frmOne.win22.value = thirteenth[3]
document.frmOne.win23.value = thirteenth[4]
document.frmOne.win24.value = thirteenth[5]

document.frmOne.win25.value = fourteenth[2]
document.frmOne.win26.value = fourteenth[3]
document.frmOne.win27.value = fourteenth[4]
document.frmOne.win28.value = fourteenth[5]

document.frmOne.win29.value = fifteenth[2]
document.frmOne.win30.value = fifteenth[3]
document.frmOne.win31.value = fifteenth[4]
document.frmOne.win32.value = fifteenth[5]

document.frmOne.draws.value = drawcounter * 100
document.frmOne.tickets.value = drawcounter * 400
document.frmOne.cost.value = cost
document.frmOne.win33.value = winnings
}
</script>

<BODY bgcolor =#7ff07f>
<Form name = frmOne>
<center>
<B><font size=6>
<hr>THE LOTTERY</hr><BR></font>

<table width=99%>
<tr>
<td width=33%><center>
<textarea name = taAll rows = 5 cols = 6></textarea></center>
</td>
<td width=33%><FONT face="Comic Sans MS" size=5><center><B>
<span id="hp">Time Wasted in Dog<BR>Years 0</span></center></B></font>
</td>
<td width=33%><center>
<textarea name = taSix rows = 5 cols = 6></textarea></center>
</td>
</tr>
</table>

<table width=80% BGcolor=#0f0f0f>
<tr>
<td width=8% bgcolor=#00cfcf></td>
<td width=44% bgcolor=#00cfcf><center><B>Tickets</B></center></td>
<td width=12.5% bgcolor=#c0c0cf><center><B>Jackpot</B></center></td>
<td width=12.5% bgcolor=#c0c0cf><center><B>1,000.00\$</B></center></td>
<td width=12.5% bgcolor=#c0c0cf><center><B>30.00\$</B></center></td>
<td width=12.5% bgcolor=#c0c0cf><center><B>3.00\$</B></center></td>
<tr>
<td width=8% bgcolor=#cfcf8f><center><B>0.5 of 4</B></center></td>
<td width=44% bgcolor=#cfcf8f><center>
<InPUT type = text name = n1 size = 3 value = 1>
<InPUT type = text name = n2 size = 3 value = 2>
<InPUT type = text name = n3 size = 3 value = 3>
<InPUT type = text name = n4 size = 3 value = 4>
<InPUT type = text name = n5 size = 3 value = 5>
<InPUT type = text name = n6 size = 3 value = 6>
</center>
</td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win1 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win2 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win3 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win4 size = 5 value = "">
</center>
</td>
</tr>

<tr>
<td width=8% bgcolor=#cfcf8f><center><B>1 of 4</B></center></td>
<td width=44% bgcolor=#cfcf8f><center>
<InPUT type = text name = n7 size = 3 value = 7>
<InPUT type = text name = n8 size = 3 value = 8>
<InPUT type = text name = n9 size = 3 value = 9>
<InPUT type = text name = n10 size = 3 value = 10>
<InPUT type = text name = n11 size = 3 value = 11>
<InPUT type = text name = n12 size = 3 value = 12>
</center>
</td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win5 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win6 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win7 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win8 size = 5 value = "">
</center>
</td>
</tr>

<tr>
<td width=8% bgcolor=#00cfcf><center><B>1.5 of 4</B></center></td>
<td width=44% bgcolor=#00cfcf><center>
<InPUT type = text name = n13 size = 3 value = 13>
<InPUT type = text name = n14 size = 3 value = 14>
<InPUT type = text name = n15 size = 3 value = 15>
<InPUT type = text name = n16 size = 3 value = 16>
<InPUT type = text name = n17 size = 3 value = 17>
<InPUT type = text name = n18 size = 3 value = 18>
</center>
</td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win9 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win10 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win11 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win12 size = 5 value = "">
</center>
</td>
</tr>

<tr>
<td width=8% bgcolor=#00cfcf><center><B>2 of 4</B></center></td>
<td width=44% bgcolor=#00cfcf><center>
<InPUT type = text name = n19 size = 3 value = 19>
<InPUT type = text name = n20 size = 3 value = 20>
<InPUT type = text name = n21 size = 3 value = 21>
<InPUT type = text name = n22 size = 3 value = 22>
<InPUT type = text name = n23 size = 3 value = 23>
<InPUT type = text name = n24 size = 3 value = 24>
</center>
</td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win13 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win14 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win15 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win16 size = 5 value = "">
</center>
</td>
</tr>

<tr>
<td width=8% bgcolor=#cfcf8f><center><B>2.5 of 4</B></center></td>
<td width=44% bgcolor=#cfcf8f><center>
<InPUT type = text name = n25 size = 3 value = 25>
<InPUT type = text name = n26 size = 3 value = 26>
<InPUT type = text name = n27 size = 3 value = 27>
<InPUT type = text name = n28 size = 3 value = 28>
<InPUT type = text name = n29 size = 3 value = 29>
<InPUT type = text name = n30 size = 3 value = 30>
</center>
</td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win17 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win18 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win19 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win20 size = 5 value = "">
</center>
</td>
</tr>

<tr>
<td width=8% bgcolor=#cfcf8f><center><B>3 of 4</B></center></td>
<td width=44% bgcolor=#cfcf8f><center>
<InPUT type = text name = n31 size = 3 value = 31>
<InPUT type = text name = n32 size = 3 value = 32>
<InPUT type = text name = n33 size = 3 value = 33>
<InPUT type = text name = n34 size = 3 value = 34>
<InPUT type = text name = n35 size = 3 value = 35>
<InPUT type = text name = n36 size = 3 value = 36>
</center>
</td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win21 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win22 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win23 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#c0c0ef><center><InPUT type = text name = win24 size = 5 value = "">
</center>
</td>
</tr>
<tr>
<td width=8% bgcolor=#00cfcf><center><B>3.5 of 4</B></center></td>
<td width=44% bgcolor=#00cfcf><center>
<InPUT type = text name = n37 size = 3 value = 37>
<InPUT type = text name = n38 size = 3 value = 38>
<InPUT type = text name = n39 size = 3 value = 39>
<InPUT type = text name = n40 size = 3 value = 40>
<InPUT type = text name = n41 size = 3 value = 41>
<InPUT type = text name = n42 size = 3 value = 42>
</center>
</td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win25 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win26 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win27 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win28 size = 5 value = "">
</center>
</td>
</tr>

<tr>
<td width=8% bgcolor=#00cfcf><center><B>4 of 4</B></center></td>
<td width=44% bgcolor=#00cfcf><center>
<InPUT type = text name = n43 size = 3 value = 43>
<InPUT type = text name = n44 size = 3 value = 44>
<InPUT type = text name = n45 size = 3 value = 45>
<InPUT type = text name = n46 size = 3 value = 46>
<InPUT type = text name = n47 size = 3 value = 47>
<InPUT type = text name = n48 size = 3 value = 48>
</center>
</td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win29 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win30 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win31 size = 5 value = "">
</center></td>
<td width=12.5% bgcolor=#d0d0cf><center><InPUT type = text name = win32 size = 5 value = "">
</center>
</td>
</tr>
<tr>
<td width=100% colspan=6 bgcolor=#ffffff><center><b>
<table width=100% BGcolor=#ff4f4f>
<tr width=50%>
<td><p align=right>
<b>Number of drawings: </b><InPUT type = text name = draws size = 5 value = "">#
</p></td>
<td><p align=right>
<b>Winnings : </b><InPUT type = text name = win33 size = 5 value = "">\$
</p></td>
</tr>
<tr width=50%>
<td><p align=right>
<b>Retail Cost of Tickets: </b><InPUT type = text name = tickets size = 5 value = "">\$
</p></td>
<td><p align=right><b>
Total Cost After Winnings : </b><InPUT type = text name = cost size = 5 value = "">\$</p>
</td>
</tr>
</table>
</tr>
</TABLE>
</center>
<P align = center>

<INPUT TYPE = button Name = b1 Value = " Get Lottery Numbers" onClick = getNumbers()>
</P>
</form>

Thursday, February 12, 2009 8:25 PM
• howdy guys

thansk for all of the replies - i use the guid it produced a really good set of random numbers and letters.

thanks nick
Friday, February 13, 2009 2:18 AM