okay, i have taken all considerations and have done this so far,i printed my code and output but it still isnt working how i want it to
thanks
code
Code:
void filldeck(Card *deckptr)
{
char x;
char y;
for(x=3;x<7;x++)
{
for(y=2;y<14;y++)
{
deckptr -> suitValue = x;
deckptr -> faceValue = y;
}
deckptr++;
}
return;
}
void shuffledeck(Card *deckptr)
{
Card temp[52];
int x, y, m = 52 / 2;
for (x = 0, y = 0; x < 52; x += 2, y++)
{
temp[x] = deckptr[y];
temp[x + 1] = deckptr[m + y + 1];
}
for (x = 0; x < 52; x++)
deckptr[x] = temp[x];
return;
}
void dealdeck(Card *deckptr , Card handsDealt [4][5])
{
int i;
char faces[]={"023456789TJQKA"};
printf("\n");
for(i=0;i<5;i++)
{
printf("%26c of %c, \n",faces[deckptr[i].faceValue], deckptr[i].suitValue);
}printf("\n");
for(i=0;i<5;i++)
{
printf("%c of %c, ",faces[deckptr[i].faceValue], deckptr[i].suitValue);
printf("%43c of %c, \n",faces[deckptr[i].faceValue], deckptr[i].suitValue);
}
printf("\n");
for(i=0;i<5;i++)
{
printf("%26c of %c, \n",faces[deckptr[i].faceValue], deckptr[i].suitValue);
}printf("\n");
return;
}
output
Code:
A of ♥,
A of ♦,
A of ♣,
A of ♠,
╠ of ╠,
A of ♥, A of ♥,
A of ♦, A of ♦,
A of ♣, A of ♣,
A of ♠, A of ♠,
╠ of ╠, ╠ of ╠,
A of ♥,
A of ♦,
A of ♣,
A of ♠,
╠ of ╠,