Hi guys!
Well, I'm designing a little lottery number generator that picks a -user-specified amount of random numbers- -between a specified minimum and maximum range-, and for a user-specified number of games. These values are then forwarded to a listbox where each row is a seperate game (with the game's random numbers displayed). I'm attempting to use a multidimensional array for this, but I've been running into a little bit of problems
Can anyone tell me what they think the problem with my code is? The values that are passed to the listbox all seem to be zeroes.
Here is the problematic array:
Dim intMini As Integer
Dim intMaxi As Integer
Dim Number As Integer
Dim rand As New Random
Dim Rows As Integer
Dim Cols As Integer
Dim intPicks As Integer
Dim intGames As Integer
intMini = CInt(txtMinNumber.Text)
intMaxi = CInt(txtMaxNumber.Text)
intPicks = CInt(txtNumbersPerPick.Text)
intGames = CInt(txtNumberOfGames.Text)
Dim ArrNumbers(intPicks, intGames) As Integer
For Rows = 0 To intPicks
For Cols = 0 To intfGames
N = rand.Next(intMaxi + 1) - intMini
lstOutput.Items.Add(ArrNumbers(Rows, Cols).ToString())
Next Cols
Next Rows
Thank you! I'll be ETERNALLY grateful!