[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
oops... RE: [pbmserv-dev] Blackout - Following suit
A little mistake... handptr was defined a bit too late.
const char *Blackout::ForcedMove(void)
{
/* changed ReadWriteCardList to Hand to use CountSuit */
Hand *hptr[MaxPlayers()];
hptr[0] = &hand1;
hptr[1] = &hand2;
hptr[2] = &hand3;
hptr[3] = &hand4;
int i,maxh=0,bidding=0;
for (i=0 ; i<players.Count() ; i++) {
if (hptr[i]->Count() > maxh)
maxh = hptr[i]->Count();
if (bids[i] == -1)
bidding=1;
}
/* Changed to follow suit automatically */
if (!bidding) {
Hand *handptr=hptr[CurrentPlayer()];
if (maxh == 1) {
return (*handptr)[0].CardAbbrev();
} else {
if (trick.Count() && (handptr->CountSuit(lead) == 1)) {
SUITS lead;
lead = trick[0].GetSuit();
for (i=0 ; i<handptr->Count() ; i++)
if ((*handptr)[i].GetSuit() == lead)
return (*handptr)[i].CardAbbrev();
}
}
}
return NULL;
}
_____________________________________________________________________
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France
To unsubscribe, send a message to esquire@gamerz.net with
unsubscribe pbmserv-dev@gamerz.net
as the BODY of the message. The SUBJECT is ignored.
_____________________________________________________________________
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France
_____________________________________________________________________
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France