|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T m
Length: 840 (0x348)
Types: TextFile
Names: »mate.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
└─⟦this⟧ »EUUGD18/General/Kriegspiel/mate.c«
/* mate.c */
#include "externs.h"
mate (pawnattempts, color)
int pawnattempts, color;
{
LIST l, tos, piecemoves ();
int from, to;
l = piecelocs [color];
while (l != NIL) {
from = l->i;
l = l->n;
tos = piecemoves (from, FALSE);
while (tos != NIL) {
to = tos->i;
tos = tos->n;
if (moveintocheck (from, to))
continue;
if (occupant [from] == PAWN
&& from % 10 != to % 10
&& pawnattempts > 3
&& option [ANNOUNCEPAWNS] == TRUE)
continue;
return FALSE;
}
}
return TRUE;
}
insufficient ()
{
int i, p, minorpieces = 0;
LIST l;
for (i = 0; i < 2; i++) {
l = piecelocs [i];
while (l != NIL) {
p = occupant [l->i];
if (p == QUEEN || p == ROOK || p == PAWN)
return FALSE;
if (p == KNIGHT || p == BISHOP)
minorpieces++;
l = l->n;
}
}
return (minorpieces <= 2);
}