Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int[] GenerateRandomizedIntArray(int size, int MinValue, int MaxValue)
- {
- size = Math.Abs(size);
- if (MinValue > MaxValue) //Incase of trolls
- {
- int temp = MinValue;
- MinValue = MaxValue;
- MaxValue = temp;
- }
- int[] output = new int[size];
- Random r = new Random();
- for (int i = 0; i < output.Length; i++)
- output[i] = r.Next(MinValue, MaxValue+1);
- return output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement