Skip to content

Instantly share code, notes, and snippets.

@mikakolari
mikakolari / gist:6793147
Created October 2, 2013 12:48
Get random numbers
public static int[] getRandoms(int count, int max)
{
int[] results = new int[count];
var mask = new BitArray(max + 1);
int counter = 0;
while (counter < count)
{
int r = random.Next(max + 1);
if (!mask[r])
{