hi can someone please help me out with this card game excercise in C. I have attempted most of the code, there is no output as yet because i havent completed the code. So i just need someone to fill in the missing pieces of code whereever there is a comment, and give me some hints and tips.

kind regards
Atif.





code:--------------------------------------------------------------------------------
/*****************************************/

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

/* handy typedefs */
typedef unsigned char card;
typedef unsigned char pairs;

/* arrays for the names of things */
static char *suits[] = {"Hearts","Diamonds","Clubs","Spades"};
static char *face[] = {"Ace","Two","Three","Four","Five","Six",\
"Seven","Eight","Nine","Ten","Jack",\
"Queen","King"};
static char *colour[]= {"Black","Red"};


/* function prototypes */
void printcard(card c,int showcolour); /* Displays the value of a card*/

void printdeck(card deck[52]); /* prints an entire deck of cards*/

void filldeck(card deck[52]); /* Populates a deck of cards */

void shuffle(card deck[52]); /* Randomizes the order of cards */

int compareface(const void* c1,const void *c2);
/* compares the face value of 2 cards, suitable to pass to qsort as the fourth argument */

pairs findpairs(card *hand); /* finds any pairs in a hand */

int main()
{

card deck[52],*deckp;
card hands[5][5],handssorted[5][5];
pairs numpairs[5],highest;
int hand,cd,winner;

srand(time(NULL)); /* seed the random number generator */


exit(0);



/*populate and shuffle the deck */
filldeck(deck);
printdeck(deck);
shuffle(deck);
printdeck(deck);

for(cd=0;cd<5;cd++)
{
for(hand=0;hand<5;hand++)
{

int cur_card = 0;
handssorted[cd][hand] = deck[cur_card];
cur_card++;
}
}


for(hand=0;hand<5;hand++)
{
qsort(handssorted[hand], 5, sizeof(card), compareface);

numpairs[hand]=findpairs(handssorted[hand]);

printf("Hand %i:",hand+1);

/* print the hands here */

}

/* determine the winner and print it */
return 0;
}
}
pairs findpairs(card *hand)
{
pairs numpairs=0;

/* find the pairs here */
return numpairs;

}

void filldeck(card deck[52])
{
int i;
for(i = 0; i < 52; i++)
{

deck[i] = suits[i/13];
deck[i] = face[i % 13];
deck[i] = colour[i /26];

}
return;
}

void printdeck(card deck[52])
{


for(i=0; i < 52; i++)
{
printf(deck[i]);
printf(" ");
}

return;
}


void printcard(card c, int showcolour)
{
/* print the value of the card here */
return;

}


void shuffle(card deck[52])
{

int i,j, rnd;
card c;

for(i=0;i<52;i++)
{
for(j=0; j< 52; j++)
{
rnd=rand()%52;
c = deck[i];
deck[i]=deck[j];
deck[j] = c;

}
}

return;
}

int compareface(const void* c1, const void *c2)
{
card cd1,cd2;

cd1=*((card*) c1);
cd2=*((card*) c2);

cd1= (cd1&0x3c)>>2;
cd2= (cd2&0x3c)>>2;

if(cd1>cd2)
return 1;
if(cd1==cd2)
return 0;

return -1;
}