Hello people!
I need ideas about how to randomly generate a set of integers - a set of 16 on 40 rows.
I had tried the Randomize function on the .net framework but has not been successful. Any idea woud be appreciated
jamello
158
Posting Whiz in Training
Recommended Answers
Jump to PostUse the Random Class.
Dim arbit As New Random Randomize() X: For i = 0 To a.GetUpperBound(0) t = arbit.Next(1, 10) ' Generate between the numbers 1 and 10 If Array.IndexOf(a, t) = -1 Then a(i) = t Else GoTo X End If Next
Here I am …
Jump to PostTry this-
Just generate 16 x 40 numbers random numbers using the code. If you want it in the range as said, find the remainder of the generated random numbers on division by 10. Then split this one dimensional array into the matrix you need.
------
Hopefully you will …
Jump to PostSince you want to create 40 unique groups where within a group a number may repeat.
Create a array of string and every time a group is created store that as a string.
Just compare the contents of the string with the newly created group. if they are the same …
All 10 Replies
tuse
22
Junior Poster
jamello
158
Posting Whiz in Training
tuse
22
Junior Poster
tuse
22
Junior Poster
jamello
158
Posting Whiz in Training
tuse
22
Junior Poster
jamello
commented:
nice one tuse. thanks
+2
jamello
158
Posting Whiz in Training
prasu
1
Newbie Poster
tuse
commented:
Very good logic
+1
tuse
22
Junior Poster
jamello
158
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.