Hello to all of you,
I just registered here, because I wanted help on implementing a programming idea I had the past days.
I am kind of new in programming generally and I found it a good idea to ask here first.
So, let's say I have about 900 sets of 6 numbers stored somewhere (maybe in arrays?). I want each time to generate a random set of 6 numbers that is different than the other 900. If it is the same (check with the other 900), then don't accept it and generate a new. I thought of using arrays and check the new set with the others each time, but I think it's a little "painful" to have 900 arrays before.
Any ideas would be appreciated! Thanks!
2 Replies - 3703 Views - Last Post: 25 July 2012 - 06:56 AM
Replies To: Problem on implementing an idea in web development
Re: Problem on implementing an idea in web development
Posted 25 July 2012 - 06:56 AM
Um, if you cant or dont want to use a database, you might want to use a List<> to store your 900 sets of numbers, this way you have a dynamic container in which you can add and remove items. If your sets are in a type that can be compaired with a - thelistWithTheSets.Contains(therandomSet) will save you some writing of iterations.
Page 1 of 1