#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

int max;
int *deck;
int i,j,redo;

int main (int argc,char *argv[])
{
	if (argc == 1) {
		printf ("need a count.\n");
		exit (0);
	}
	max = atoi (argv[1]);
	if ((max < 100) || (max > 1000000L)) {
		printf ("unreasonable values of max (0 < max < 1,000,000)\n");
		exit (0);
	}
	deck = (int *)malloc(max * sizeof(int));
	for (i=0;i<max;i++) {
		do {
			redo = 0;
			deck[i] = random() % max;
			for (j=0;j<i;j++) {
				if (deck[i] == deck[j]) redo = 1;
			}
		} while (redo == 1);
	}
	return 0;
}


		

