Linked Questions

24 votes
2 answers
89k views

I need to rearrange my List array, it has a non-determinable number of elements in it. Can somebody give me example of how i do this, thanks
brux's user avatar
  • 3,230
18 votes
4 answers
21k views

Possible Duplicate: Randomize a List<T> in C# I have a list which contains many thousands of FilePath's to locations of audio files, and was wondering which would be the most efficient way ...
user avatar
6 votes
4 answers
12k views

Using C# to write a memory game. So I have a list of 54 images. I can get another list to grab eight of them images at random. I then want to add them eight images from my second list to another list, ...
Daniel Lucas's user avatar
1 vote
4 answers
5k views

I found this piece of Java code at Wikipedia that is supposed to shuffle an array in place: public static void shuffle (int[] array) { Random rng = new Random(); int n = array.length; ...
golden_eagle's user avatar
9 votes
2 answers
39k views

Possible Duplicate: Randomize a List<T> in C# shuffle (rearrange randomly) a List<string> Random plot algorithm Hi I have the following list and I want to output the model into a ...
Peter Crouch's user avatar
3 votes
1 answer
21k views

I have a List of colors that I would like to be shuffled and mixed up at least a little. I create a list using List<Color> colors = new List<Color> (); colors.Add(Color.Black); colors....
Dan's user avatar
  • 1,110
-5 votes
3 answers
11k views

Possible Duplicate: Randomize a List<T> in C# I want to make a program that ask the user 5 questions in random without duplicate the questions, and if the question is right go through the ...
Bahinour's user avatar
0 votes
1 answer
9k views

What I need to do is randomly shuffle an array of 25 numbers int[] arr = Enumerable.Range(0, 24).ToArray(); So that it still has all the numbers from 0 to 24 but in a random order. What would be the ...
Ayukawa's user avatar
  • 11
4 votes
6 answers
4k views

I need a quick algorithm to select 4 random elements from a generic list. For example, I'd like to get 4 random elements from a List and then based on some calculations if elements found not valid ...
techV's user avatar
  • 935
1 vote
5 answers
2k views

Can you help me to find a way to randomize arrays? E.g.: int[] arrayInt = { 1, 2, 3, 4, 5, 6, 7 }; after randomizing, the result should be stored in another array. And when you randomize again it ...
RevyToxic's user avatar
0 votes
3 answers
2k views

I am trying to make code that gives me a random variable from a list of strings, but I do not want it to give me a variable I already got. Here some code for u my dude ↓↓↓ public Text[] ...
theSuperLoaf's user avatar
-1 votes
2 answers
4k views

I'm currently trying to create a program that generates random numbers between 1 and 45 with no duplicates. My program works when I run it without the else statement whenever a duplicate comes up it ...
Khargan Powell's user avatar
-1 votes
1 answer
2k views

Whats the quickest way to generate a list of consecutive numbers in a random order? i.e. generate a list of numbers from 1 to 100, the list must contain each number once only. The order of the list ...
mfc's user avatar
  • 3,036
0 votes
3 answers
1k views

I need to print numbers from 1 to 50 in random order without repeating it . static void Main(string[] args) { ArrayList r = new ArrayList(); Random ran = new Random(); for (int ...
user2845236's user avatar
0 votes
3 answers
625 views

I have string list of a deck of card the strings are as such, A-DIAMONDS, 2-CLUBS, etc. I want to be able to generate 5 unique items from this list randomly. I know how to do this in python with ...
Jimmy COttom's user avatar

15 30 50 per page
1
2 3 4 5
17