To randomize an array:
Code:
for (i=0; i<ARRAY_SIZE-1; i++)
{
j = i + rand()%(ARRAY_SIZE-i);
if (i != j)
swap (array[i], array[j]);
}
The idea is this:
The first element gets a random card.
The second element gets a random card from the remaining 51
...
The last guy gets the last leftover card.