1
Reply

two dimensional array

neil cowan

neil cowan

Feb 1 2009 7:28 AM
8.1k

Hi

Im new to vb and am trying to work out how to populate a two dimensional array.  But i am tring to insert number 1  in when the col = the random number.

Example i have 5 random numbers eg 1 would be 10000 ,2  01000 ,3 00100 etc this would enable me to add up the col and determine how many of each random number i have.

Dim dice(4, 5) As Integer

For i = 0 To dice.GetUpperBound(0)

For j = 0 To dice.GetUpperBound(1)

Dim x As Int16 = CInt(Rnd() * 5)

dice(i, x) = 1

Next

Next

can any one help please. Thanks in advance


Answers (1)