조커 뺐다.



#include <stdlib.h>


#define CARD_COUNT  52

int deck[CARD_COUNT];


void shuffle()

{

    for(int i = 0; i < CARD_COUNT; ++i) deck[i] = i;

    for(int target = CARD_COUNT - 1; target > 0; --target)

    {

        int select = rand() % (target + 1);

        if(target == select) continue;

        deck[target] ^= deck[select] ^= deck[target] ^= deck[select];

    }

}