I have a method that accepts as argument an array of integers and I\'d just change arbitrary the order of its values
public static int[] _game_number = new
You can do something like this
public static int[] GetRandomTwentyFour(int[] _game_number)
{
int len = _game_number.Length;
int[] _current_number = new int[len];
List nums = new List();
Random r = new Random();
for (int i = 0; i < len; i++)
{
int rand = r.Next(0, len);
if (nums.Contains(rand))
{
i = i - 1;
continue;
}
else
nums.Add(rand);
}
for (int i = 0; i < nums.Count; i++)
_current_number[i] = _game_number[nums[i]];
return _current_number;
}
Here is the proof
