[RESOLVED] List or Array?
Hello,
I am working on a Card game, and i have a little question. I want to put all the cards in a array or list. The problem is that the list need to be shuffled/randomised. But it should also be able to shrink. Witch of those 2 is better to use? And how can i shuffle them?
Please tell me,
ThijsD
Re: [RESOLVED] List or Array?
jmcilhinney has a very nice 'Randomize list' codebank submission which shuffles a list randomly with much less code using LINQ. The query is something simple as this:
Code:
From item As Integer In yourList _
Order By rnd.NextDouble() _
Select item
where 'rnd' is a Random object.