I'm trying to do as you said with running a count by checking through a second array but I'm running into some problems. Here, a card could have faces in the range 0-12. I'm setting all the values in the array as a default then checking it against a face value that was previously played by someone else to see if this player has cards higher than the one played and how much of these cards he actually has. The code is giving me some problems. Any help would be appreciated.
Code:
int Compare(CardPtr Hand, int faceValue){
int arrDoubleCheck[NCARDS]; //Using a second array to keep track of the occurences of each face value
int i,j=0; /*counters*/
int chk; /*checker against first array*/
for (i=0;i<NCARDS;i++){
arrDoubleCheck[i] = 0; //setting every card count as default 0
chk = Hand[i].face; //keeping track of the index
printf("\n Check %d and Hand %d, ", chk, Hand[i].face);
if (Hand[i].face > faceValue){
arrDoubleCheck[chk]++; //increments the value in position
}
}
for (i=0;i<NCARDS;i++){
printf("\nCounts in 2nd array: %d, ", arrDoubleCheck[i]);
}
return 0;
}