-/* $NetBSD: comp.c,v 1.5 1997/10/12 00:53:45 lukem Exp $ */
+/* $NetBSD: comp.c,v 1.8 1999/09/30 18:01:32 jsm Exp $ */
/*
* Copyright (c) 1982, 1993
#if 0
static char sccsid[] = "@(#)comp.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: comp.c,v 1.5 1997/10/12 00:53:45 lukem Exp $");
+__RCSID("$NetBSD: comp.c,v 1.8 1999/09/30 18:01:32 jsm Exp $");
#endif
#endif /* not lint */
if (foundend)
foundend = !check_ext(TRUE);
for (i = 0; safe && i < HAND_SZ; i++) {
- if (issafety(pp->hand[i])) {
+ if (is_safety(pp->hand[i])) {
if (onecard(op) || (foundend && cango && !canstop)) {
#ifdef DEBUG
if (Debug)
playit[i] = cango;
}
}
- if (!pp->can_go && !isrepair(pp->battle))
+ if (!pp->can_go && !is_repair(pp->battle))
Numneed[opposite(pp->battle)]++;
redoit:
foundlow = (cango || count[C_END_LIMIT] != 0
value = valbuf;
for (i = 0; i < HAND_SZ; i++) {
card = pp->hand[i];
- if (issafety(card) || playit[i] == (cango != 0)) {
+ if (is_safety(card) || playit[i] == (cango != 0)) {
#ifdef DEBUG
if (Debug)
fprintf(outf, "CALCMOVE: switch(\"%s\")\n",
diff = End - pp->mileage;
/* avoid getting too close */
if (Topcard > Deck && cango && diff <= 100
- && diff / Value[card] > count[card]
+ && (int)diff / Value[card] > count[card]
&& (card == C_25 || diff % 50 == 0)) {
if (card == C_50 && diff - 50 == 25
&& count[C_25] > 0)
#endif
value++;
}
- if (!pp->can_go && !isrepair(pp->battle))
+ if (!pp->can_go && !is_repair(pp->battle))
Numneed[opposite(pp->battle)]++;
if (cango) {
play_it:
Card_no = nummax;
}
else {
- if (issafety(pp->hand[nummin])) { /* NEVER discard a safety */
+ if (is_safety(pp->hand[nummin])) { /* NEVER discard a safety */
nummax = nummin;
goto play_it;
}
*/
int
onecard(pp)
- PLAY *pp;
+ const PLAY *pp;
{
CARD bat, spd, card;
bat = pp->battle;
spd = pp->speed;
card = -1;
- if (pp->can_go || ((isrepair(bat) || bat == C_STOP || spd == C_LIMIT) &&
+ if (pp->can_go || ((is_repair(bat) || bat == C_STOP || spd == C_LIMIT) &&
Numseen[S_RIGHT_WAY] != 0) ||
(bat >= 0 && Numseen[safety(bat)] != 0))
switch (End - pp->mileage) {
int
canplay(pp, op, card)
- PLAY *pp, *op;
+ const PLAY *pp, *op;
CARD card;
{
switch (card) {
break;
case C_GO:
if (!pp->can_go &&
- (isrepair(pp->battle) || pp->battle == C_STOP))
+ (is_repair(pp->battle) || pp->battle == C_STOP))
return TRUE;
break;
case C_END_LIMIT: