This is a part of the code. I am confused as to what the foll code works:
/* check for straight */
rank = 0;
while (num_in_rank[rank] == 0) rank++;
for (; rank < NUM_RANKS && num_in_rank[rank] > 0; rank++)
num_consec++;
if (num_consec == NUM_CARDS) {
straight = true;
return;
say if the hands are 2d,3d,4d,5d,6d how wld the code work?