Linked Questions
255 questions linked to/from Randomize a List<T>
24
votes
2
answers
89k
views
shuffle (rearrange randomly) a List<string> [duplicate]
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
18
votes
4
answers
21k
views
Shuffle List<T> [duplicate]
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 ...
6
votes
4
answers
12k
views
How to shuffle a list [duplicate]
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, ...
1
vote
4
answers
5k
views
How to shuffle a List<T> [duplicate]
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;
...
9
votes
2
answers
39k
views
Randomly shuffle a List [duplicate]
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 ...
3
votes
1
answer
21k
views
Simple way to randomly shuffle list [duplicate]
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....
-5
votes
3
answers
11k
views
Making a program that ask the user 5 questions in random without duplicate the questions [duplicate]
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 ...
0
votes
1
answer
9k
views
Randomly shuffling an array [duplicate]
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 ...
4
votes
6
answers
4k
views
algorithm for selecting N random elements from a List<T> in C# [duplicate]
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 ...
1
vote
5
answers
2k
views
Randomise an array of integers [duplicate]
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 ...
0
votes
3
answers
2k
views
Unity C# How do I make a random number that doesn't repeat? [duplicate]
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[] ...
-1
votes
2
answers
4k
views
c# random number generator in an array with no duplicates [duplicate]
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 ...
-1
votes
1
answer
2k
views
Quickest way to generate a sequence of consecutive numbers in a random order [duplicate]
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 ...
0
votes
3
answers
1k
views
How to make this code work without repeating the numbers? [duplicate]
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 ...
0
votes
3
answers
625
views
Generating Random Unique items from a string list [duplicate]
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 ...