v13i059: xboard, Part03/06

dbs at Pa.dec.com dbs at Pa.dec.com
Mon Jun 24 23:40:35 AEST 1991


Submitted-by: dbs at Pa.dec.com
Posting-number: Volume 13, Issue 59
Archive-name: xboard/part03

---- Cut Here and feed the following to sh ----
#!/bin/sh
# this is xx.03 (part 3 of a multipart archive)
# do not concatenate these parts, unpack them in order with /bin/sh
# file xboard/xboard.man continued
#
if test ! -r _shar_seq_.tmp; then
	echo 'Please unpack part 1 first!'
	exit 1
fi
(read Scheck
 if test "$Scheck" != 3; then
	echo Please unpack part "$Scheck" next!
	exit 1
 else
	exit 0
 fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
	echo 'x - still skipping xboard/xboard.man'
else
echo 'x - continuing file xboard/xboard.man'
sed 's/^X//' << 'SHAR_EOF' >> 'xboard/xboard.man' &&
..IR xboard .
..SH SEE ALSO
..IR xchess (1),
..IR gnuchess (1)
..SH LIMITATIONS
..LP
Doesn't handle black to play positions.
..LP
White must be on move for two program mode to work.
..LP
Only recognizes algebraic notation.
..LP
If you press the Pause button during GNU Chess's turn
..IR xboard .
will stop the clocks,
but GNU Chess will still make a move.
..LP
If you play out an opening set of moves with
..IR "Play From File" ,
you must make a move and then select
..IR "Machine Black" .
..LP
-iconic doesn't work properly.
..SH COPYRIGHT
..LP
Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts.
..LP
All Rights Reserved
..LP
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
..LP
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
SHAR_EOF
echo 'File xboard/xboard.man is complete' &&
chmod 0644 xboard/xboard.man ||
echo 'restore of xboard/xboard.man failed'
Wc_c="`wc -c < 'xboard/xboard.man'`"
test 11585 -eq "$Wc_c" ||
	echo 'xboard/xboard.man: original size 11585, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= xboard/patchlevel.h ==============
if test -f 'xboard/patchlevel.h' -a X"$1" != X"-c"; then
	echo 'x - skipping xboard/patchlevel.h (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting xboard/patchlevel.h (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'xboard/patchlevel.h' &&
#define PATCHLEVEL 4
SHAR_EOF
chmod 0644 xboard/patchlevel.h ||
echo 'restore of xboard/patchlevel.h failed'
Wc_c="`wc -c < 'xboard/patchlevel.h'`"
test 21 -eq "$Wc_c" ||
	echo 'xboard/patchlevel.h: original size 21, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= xboard/parser.l ==============
if test -f 'xboard/parser.l' -a X"$1" != X"-c"; then
	echo 'x - skipping xboard/parser.l (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting xboard/parser.l (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'xboard/parser.l' &&
%{
/*
X * parser.l -- lex parser of algebraic chess moves for XBoard
X *
X * Chris Sears
X *
X * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X * All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X *
X * This parser handles all forms of promotion.
X * XBoard and GnuChess only handle queen promotion.
X * The parser resolves ambiguous moves by searching and check-testing.
X * It also parses comments of the form [anything] and ! to end of line.
X */
#include "xboard.h"
#include <ctype.h>
#include <string.h>
X
enum { False, True };
X
#define A_I(ch)			(tolower(ch) - 'a')
#define NO_CONSTRAINT	-1
#undef input
X
#define KING_TEST(r, f, piece) { \
X	if ((r >= 0) && (r < BOARD_SIZE) && (f >= 0) && (f < BOARD_SIZE)) { \
X		if (boards[currentMove][r][f] == (ChessSquare) piece) { \
X			currentMoveString[0] = f + 'a'; \
X			currentMoveString[1] = r + '1'; \
X			break; \
X		} \
X	} \
}
X
#define PIECE_TEST(r, f, piece) { \
X	if ((r >= 0) && (r < BOARD_SIZE) && (f >= 0) && (f < BOARD_SIZE)) { \
X		if (boards[currentMove][r][f] == (ChessSquare) piece) { \
X			if (! CheckTest(rank, file, r, f)) { \
X				currentMoveString[0] = f + 'a'; \
X				currentMoveString[1] = r + '1'; \
X				break; \
X			} \
X		} \
X	} \
}
X
#define PROMOTION_PIECE(p) { \
X	currentMoveString[5] = '\n'; \
X	currentMoveString[6] = '\0'; \
X	switch (p) { \
X	case 'n': case 'N': \
X		currentMoveString[4] = 'n'; \
X		return WHITE_ON_MOVE \
X			? (int) WhitePromotionKnight : (int) BlackPromotionKnight; \
X	case 'b': case 'B': \
X		currentMoveString[4] = 'b'; \
X		return WHITE_ON_MOVE \
X			? (int) WhitePromotionBishop : (int) BlackPromotionBishop; \
X	case 'r': case 'R': \
X		currentMoveString[4] = 'r'; \
X		return WHITE_ON_MOVE \
X			? (int) WhitePromotionRook : (int) BlackPromotionRook; \
X	case 'q': case 'Q': \
X		currentMoveString[4] = 'q'; \
X		return WHITE_ON_MOVE \
X			? (int) WhitePromotionQueen : (int) BlackPromotionQueen; \
X	default: \
X		return (int) BadMove; \
X	} \
}
X
extern Board	boards[MAX_MOVES];
extern int		currentMove;
extern int		xboardDebug;
extern FILE		*gameFileFP;
char			currentMoveString[YYLMAX];
X
static int RookSearch P((int *rank, int *file,
X	ChessSquare piece, Board b, int recurse, int constraint));
static int BishopSearch P((int *rank, int *file,
X	ChessSquare piece, Board b, int recurse, int constraint));
static int CheckTest P((int rt, int ft, int rf, int ff));
static int yywrap P((void));
static int input P((void));
extern void CopyBoard P((Board to, Board from));
X
%}
%%
X
!.*$						{ return (int) Comment; }	/* combining doesn't work */
\[[^\]]*\]					{ return (int) Comment; }
[ \t\n]						{ ; }				/* skip white space */
X
[a-hA-H][1-8][a-hA-H][1-8]|[a-hA-H][1-8][a-hA-H][1-8]\(?[RrBbNnQq]\)?|[a-hA-H][1-8][xX-][a-hA-H][1-8]|[a-hA-H][1-8][xX-][a-hA-H][1-8]\(?[RrBbNnQq]\)?	{
/*
X * Simple algebraic move with promotion
X */
X		/*
X		 * remove the [xX-] to simplify the logic
X		 */
X		if ((yytext[2] == 'x') || (yytext[2] == 'X') || (yytext[2] == '-')) {
X			int i;
X
X			for (i = 2, yyleng--; i < yyleng + 1; i++)
X				yytext[i] = yytext[i + 1];
X		}
X
X		strcpy(currentMoveString, yytext);
X		currentMoveString[4] = '\n';
X		currentMoveString[5] = '\0';
X
X		if (yyleng == 4)
X			return (int) NormalMove;
X		if (yyleng > 5) {
X			PROMOTION_PIECE(yytext[5]);
X		} else {
X			PROMOTION_PIECE(yytext[4]);
X		}
X	}
X
[a-hA-H][1-8]|[a-hA-H][1-8]\(?[RrBbNnQq]\)?	{
/*
X * Pawn move with promotion
X */
X		int rank = yytext[1] - '1', file = A_I(yytext[0]);
X
X		currentMoveString[0] = yytext[0];
X		currentMoveString[1] = yytext[1];
X		currentMoveString[2] = yytext[0];
X		currentMoveString[3] = yytext[1];
X		currentMoveString[4] = '\n';
X		currentMoveString[5] = '\0';
X
X		if (WHITE_ON_MOVE) {
X			if (boards[currentMove][rank - 1][file] == WhitePawn)
X				currentMoveString[1]--;
X			else
X				currentMoveString[1] -= 2;
X		} else {
X			if (boards[currentMove][rank + 1][file] == BlackPawn)
X				currentMoveString[1]++;
X			else
X				currentMoveString[1] += 2;
X		}
X
X		if (yyleng == 2)
X			return (int) NormalMove;
X		if (yyleng > 3) {
X			PROMOTION_PIECE(yytext[3]);
X		} else {
X			PROMOTION_PIECE(yytext[2]);
X		}
X	}
X
[a-h][a-h]|[a-h][a-h]\([RrBbNnQq]\)|[a-h][xX][a-h]|[a-h][xX][a-h]\([RrBbNnQq]\)	{
/*
X * Pawn capture with promotion
X */
X		int i, p, file0, file1;
X
X		/*
X		 * remove the [xX] to simplify the logic
X		 */
X		if ((yytext[1] == 'x') || (yytext[1] == 'X'))
X			for (i = 1, yyleng--; i < yyleng + 1; i++)
X				yytext[i] = yytext[i + 1];
X
X		file0 = A_I(yytext[0]);
X		file1 = A_I(yytext[1]);
X
X		currentMoveString[0] = yytext[0];
X		currentMoveString[2] = yytext[1];
X		currentMoveString[4] = '\n';
X		currentMoveString[5] = '\0';
X
X		if (WHITE_ON_MOVE) {
X			for (i = 1; i < BOARD_SIZE - 1; i++) {
X				if (boards[currentMove][i][file0] == WhitePawn) {
X					p = (int) boards[currentMove][i + 1][file1];
X					if (((i == 4) && (p == (int) EmptySquare)	/* en passant */
X						&& (boards[currentMove][i][file1] == BlackPawn)) ||
X						((p >= (int) BlackPawn) && (p <= (int) BlackQueen))) {
X
X						currentMoveString[1] = '1' + i;
X						currentMoveString[3] = '1' + i + 1;
X						if (p == EmptySquare)
X							return (int) WhiteCapturesEnPassant;
X						if (yyleng == 2)
X							return (int) NormalMove;
X						PROMOTION_PIECE(yytext[3]);
X					}
X				}
X			}
X		} else {
X			for (i = 1; i < BOARD_SIZE - 1; i++) {
X				if (boards[currentMove][i][file0] == BlackPawn) {
X					p = (int) boards[currentMove][i - 1][file1];
X					if (((i == 3) && (p == (int) EmptySquare)	/* en passant */
X						&& (boards[currentMove][i][file1] == WhitePawn)) ||
X						((p >= (int) WhitePawn) && (p <= (int) WhiteQueen))) {
X
X						currentMoveString[1] = '1' + i;
X						currentMoveString[3] = '1' + i - 1;
X						if (p == EmptySquare)
X							return (int) BlackCapturesEnPassant;
X						if (yyleng == 2)
X							return (int) NormalMove;
X						PROMOTION_PIECE(yytext[3]);
X					}
X				}
X			}
X		}
X
X		return (int) BadMove;
X	}
X
[a-h][a-h][1-8]|[a-h][a-h][1-8]\([RrBbNnQq]\)|[a-h][xX][a-h][1-8]|[a-h][xX][a-h][1-8]\([RrBbNnQq]\)	{
/*
X * ambiguous Pawn capture with promotion
X */
X		int i;
X
X		/*
X		 * remove the [xX] to simplify the logic
X		 */
X		if ((yytext[1] == 'x') || (yytext[1] == 'X'))
X			for (i = 1, yyleng--; i < yyleng + 1; i++)
X				yytext[i] = yytext[i + 1];
X
X		currentMoveString[0] = yytext[0];
X		currentMoveString[4] = '\n';
X		currentMoveString[5] = '\0';
X
X		if (WHITE_ON_MOVE) {
X			if ((yytext[2] == '5') &&
X				(boards[currentMove][4][A_I(yytext[0])] == WhitePawn) &&
X				(boards[currentMove][5][A_I(yytext[1])] == EmptySquare)) {
X				currentMoveString[1] = '5';
X				currentMoveString[2] = yytext[1];
X				currentMoveString[3] = '6';
X				return (int) WhiteCapturesEnPassant;
X			}
X		} else {
X			if ((yytext[2] == '4') &&
X				(boards[currentMove][3][A_I(yytext[0])] == BlackPawn) &&
X				(boards[currentMove][2][A_I(yytext[1])] == EmptySquare)) {
X				currentMoveString[1] = '4';
X				currentMoveString[2] = yytext[1];
X				currentMoveString[3] = '3';
X				return (int) BlackCapturesEnPassant;
X			}
X		}
X
X		currentMoveString[2] = yytext[1];
X		currentMoveString[3] = yytext[2];
X		if (WHITE_ON_MOVE)
X			currentMoveString[1] = yytext[2] - 1;
X		else
X			currentMoveString[1] = yytext[2] + 1;
X
X		if (yyleng == 3)
X			return (int) NormalMove;
X
X		PROMOTION_PIECE(yytext[4]);
X	}
X
[RrBbNnQqKk][a-hA-H][1-8]|[RrBbNnQqKk][xX][a-hA-H][1-8]	{
/*
X * piece move
X */
X		int p, rank, file;
X
X		if ((yytext[1] == 'x') || (yytext[1] == 'X')) {
X			currentMoveString[2] = yytext[2];
X			currentMoveString[3] = yytext[3];
X			rank = yytext[3] - '1'; file = A_I(yytext[2]);
X		} else {
X			currentMoveString[2] = yytext[1];
X			currentMoveString[3] = yytext[2];
X			rank = yytext[2] - '1'; file = A_I(yytext[1]);
X		}
X
X		currentMoveString[4] = '\n';
X		currentMoveString[5] = '\0';
X
X		switch (yytext[0]) {
X		case 'R': case 'r':
X			if (!RookSearch(&rank, &file, WHITE_ON_MOVE ? WhiteRook
X				: BlackRook, boards[currentMove], (int) True, NO_CONSTRAINT))
X				return (int) BadMove;
X
X			currentMoveString[0] = file + 'a';
X			currentMoveString[1] = rank + '1';
X
X			break;
X		case 'B': case 'b':
X			if (!BishopSearch(&rank, &file, WHITE_ON_MOVE ? WhiteBishop
X				: BlackBishop, boards[currentMove], (int) True, NO_CONSTRAINT))
X				return (int) BadMove;
X
X			currentMoveString[0] = file + 'a';
X			currentMoveString[1] = rank + '1';
X
X			break;
X		case 'N': case 'n':
X			p = (int) (WHITE_ON_MOVE ? WhiteKnight : BlackKnight);
X			PIECE_TEST(rank - 2, file - 1, p);
X			PIECE_TEST(rank - 1, file - 2, p);
X			PIECE_TEST(rank + 1, file - 2, p);
X			PIECE_TEST(rank + 2, file - 1, p);
X			PIECE_TEST(rank + 2, file + 1, p);
X			PIECE_TEST(rank + 1, file + 2, p);
X			PIECE_TEST(rank - 1, file + 2, p);
X			PIECE_TEST(rank - 2, file + 1, p);
X			return (int) BadMove;
X			break;
X		case 'Q': case 'q':
X			if (!RookSearch(&rank, &file, WHITE_ON_MOVE ? WhiteQueen
X				: BlackQueen, boards[currentMove], (int) True, NO_CONSTRAINT))
X				if (!BishopSearch(&rank, &file, WHITE_ON_MOVE ? WhiteQueen
X					: BlackQueen, boards[currentMove], (int) True, NO_CONSTRAINT))
X					return (int) BadMove;
X
X			currentMoveString[0] = file + 'a';
X			currentMoveString[1] = rank + '1';
X
X			break;
X		case 'K': case 'k':
X			p = (int) (WHITE_ON_MOVE ? WhiteKing : BlackKing);
X			KING_TEST(rank - 1, file - 1, p);
X			KING_TEST(rank, file - 1, p);
X			KING_TEST(rank + 1, file - 1, p);
X			KING_TEST(rank + 1, file, p);
X			KING_TEST(rank + 1, file + 1, p);
X			KING_TEST(rank, file + 1, p);
X			KING_TEST(rank - 1, file + 1, p);
X			KING_TEST(rank - 1, file, p);
X			break;
X		}
X
X		return (int) NormalMove;
X	}
X
[RrBbNnQqKk][a-hA-H0-7][a-hA-H][1-8]|[RrBbNnQqKk][a-hA-H0-7][xX][a-hA-H][1-8]	{
/*
X * ambiguous piece move
X */
X		int p, c, rank, file;
X
X		if ((yytext[2] == 'x') || (yytext[2] == 'X')) {
X			currentMoveString[2] = yytext[3];
X			currentMoveString[3] = yytext[4];
X			rank = yytext[4] - '1'; file = A_I(yytext[3]);
X		} else {
X			currentMoveString[2] = yytext[2];
X			currentMoveString[3] = yytext[3];
X			rank = yytext[3] - '1'; file = A_I(yytext[2]);
X		}
X
X		currentMoveString[4] = '\n';
X		currentMoveString[5] = '\0';
X
X		c = tolower(yytext[1]);
X
X		switch (yytext[0]) {
X		case 'R': case 'r':
X			if (!RookSearch(&rank, &file, WHITE_ON_MOVE ? WhiteRook
X				: BlackRook, boards[currentMove], (int) True, yytext[1]))
X				return (int) BadMove;
X
X			currentMoveString[0] = file + 'a';
X			currentMoveString[1] = rank + '1';
X
X			break;
X		case 'B': case 'b':
X			if (!BishopSearch(&rank, &file, WHITE_ON_MOVE ? WhiteBishop
X				: BlackBishop, boards[currentMove], (int) True, yytext[1]))
X				return (int) BadMove;
X
X			currentMoveString[0] = file + 'a';
X			currentMoveString[1] = rank + '1';
X
X			break;
X		case 'N': case 'n':
X			p = (int) (WHITE_ON_MOVE ? WhiteKnight : BlackKnight);
X			if (isalpha(c)) {
X				c -= 'a';
X				if ((file - 1) == c) {
X					PIECE_TEST(rank - 2, file - 1, p);
X					PIECE_TEST(rank + 2, file - 1, p);
X				}
X				if ((file - 2) == c) {
X					PIECE_TEST(rank - 1, file - 2, p);
X					PIECE_TEST(rank + 1, file - 2, p);
X				}
X				if ((file + 1) == c) {
X					PIECE_TEST(rank + 2, file + 1, p);
X					PIECE_TEST(rank - 2, file + 1, p);
X				}
X				if ((file + 2) == c) {
X					PIECE_TEST(rank + 1, file + 2, p);
X					PIECE_TEST(rank - 1, file + 2, p);
X				}
X			} else {
X				c -= '1';
X				if ((rank - 2) == c) {
X					PIECE_TEST(rank - 2, file - 1, p);
X					PIECE_TEST(rank - 2, file + 1, p);
X				}
X				if ((rank - 1) == c) {
X					PIECE_TEST(rank - 1, file - 2, p);
X					PIECE_TEST(rank - 1, file + 2, p);
X				}
X				if ((rank + 2) == c) {
X					PIECE_TEST(rank + 2, file - 1, p);
X					PIECE_TEST(rank + 2, file + 1, p);
X				}
X				if ((rank + 1) == c) {
X					PIECE_TEST(rank + 1, file - 2, p);
X					PIECE_TEST(rank + 1, file + 2, p);
X				}
X			}
X			break;
X		case 'Q': case 'q':
X			if (!RookSearch(&rank, &file, WHITE_ON_MOVE ? WhiteQueen
X				: BlackQueen, boards[currentMove], (int) True, yytext[1]))
X				if (!BishopSearch(&rank, &file, WHITE_ON_MOVE ? WhiteQueen
X					: BlackQueen, boards[currentMove], (int) True, yytext[1]))
X					return (int) BadMove;
X
X			currentMoveString[0] = file + 'a';
X			currentMoveString[1] = rank + '1';
X
X			break;
X		}
X
X		return (int) NormalMove;
X	}
X
000|0-0-0|ooo|OOO|o-o-o|O-O-O	{
X		strcpy(currentMoveString, "O-O-O\n");
X		if (WHITE_ON_MOVE)
X			return (int) WhiteQueenSideCastle;
X		else
X			return (int) BlackQueenSideCastle;
X	}
X
00|0-0|oo|OO|o-o|O-O	{
X		strcpy(currentMoveString, "O-O\n");
X		if (WHITE_ON_MOVE)
X			return (int) WhiteKingSideCastle;
X		else
X			return (int) BlackKingSideCastle;
X	}
X
[Rr][Ee][Ss][Ii][Gg][Nn]	{
X		if (WHITE_ON_MOVE)
X			return (int) BlackWins;
X		else
X			return (int) WhiteWins;
X	}
X
[Mm][Aa][Tt][Ee]			{
X		if (WHITE_ON_MOVE)
X			return (int) WhiteWins;
X		else
X			return (int) BlackWins;
X	}
X
[Dd][Rr][Aa][Ww]|1\/2		{ return (int) GameIsDrawn; }
[Ww][Hh][Ii][Tt][Ee]		{ return (int) WhiteWins; }
[Bb][Ll][Aa][Cc][Kk]		{ return (int) BlackWins; }
1-0							{ return (int) WhiteWins; }
0-1							{ return (int) BlackWins; }
X
[1-9][0-9]*\.|[1-9][0-9]*	{			/* Parse and skip move numbers */
X	if ((yyleng == 1) && (yytext[0] == '1'))
X		return (int) StartGame;
X	if ((yyleng == 2) && (yytext[0] == '1') && (yytext[1] == '.'))
X		return (int) StartGame;
}
X
..							{ ; }		/* Skip everything else */
X
%%
X
static int
RookSearch(rank, file, piece, b, recurse, constraint)
X	int *rank, *file, recurse, constraint;
X	ChessSquare piece;
X	Board b;
{
X	int i, r = *rank, f = *file;
X
X	/*
X	 * Start from the target space and work outwards towards the piece.
X	 * This is necessary for check testing.
X	 */
X	for (i = f + 1;; i++) {
X		if (i >= BOARD_SIZE)
X			break;
X		if (isalpha(constraint) && (i != A_I(constraint)))
X			continue;
X		if (isdigit(constraint) && (i != (constraint - '1')))
X			continue;
X		if ((b[r][i] != EmptySquare) && (b[r][i] != piece))
X			break;
X		if (recurse)
X			if (CheckTest(r, f, r, i))
X				continue;
X		if (b[r][i] == piece) {
X			*file = i;
X			return (int) True;
X		}
X	}
X
X	for (i = f - 1;; i--) {
X		if (i < 0)
X			break;
X		if (isalpha(constraint) && (i != A_I(constraint)))
X			continue;
X		if (isdigit(constraint) && (i != (constraint - '1')))
X			continue;
X		if ((b[r][i] != EmptySquare) && (b[r][i] != piece))
X			break;
X		if (recurse)
X			if (CheckTest(r, f, r, i))
X				continue;
X		if (b[r][i] == piece) {
X			*file = i;
X			return (int) True;
X		}
X	}
X
X	for (i = r + 1;; i++) {
X		if (i >= BOARD_SIZE)
X			break;
X		if (isdigit(constraint) && (i != (constraint - '1')))
X			continue;
X		if (isalpha(constraint) && (i != A_I(constraint)))
X			continue;
X		if ((b[i][f] != EmptySquare) && (b[i][f] != piece))
X			break;
X		if (recurse)
X			if (CheckTest(r, f, i, f))
X				continue;
X		if (b[i][f] == piece) {
X			*rank = i;
X			return (int) True;
X		}
X	}
X
X	for (i = r - 1;; i--) {
X		if (i < 0)
X			break;
X		if (isdigit(constraint) && (i != (constraint - '1')))
X			continue;
X		if (isalpha(constraint) && (i != A_I(constraint)))
X			continue;
X		if ((b[i][f] != EmptySquare) && (b[i][f] != piece))
X			break;
X		if (recurse)
X			if (CheckTest(r, f, i, f))
X				continue;
X		if (b[i][f] == piece) {
X			*rank = i;
X			return (int) True;
X		}
X	}
X
X	return (int) False;
}
X
static int
BishopSearch(rank, file, piece, b, recurse, constraint)
X	int *rank, *file, recurse, constraint;
X	ChessSquare piece;
X	Board b;
{
X	int i, j, r = *rank, f = *file;
X
X	/*
X	 * Start from the target space and work outwards towards the piece.
X	 * This is necessary for check testing.
X	 */
X	for (i = r + 1, j = f + 1;; i++, j++) {
X		if ((i >= BOARD_SIZE) || (j >= BOARD_SIZE))
X			break;
X		if (isalpha(constraint) && (j != A_I(constraint)))
X			continue;
X		if (isdigit(constraint) && (j != (constraint - '1')))
X			continue;
X		if ((b[i][j] != EmptySquare) && (b[i][j] != piece))
X			break;
X		if (recurse)
X			if (CheckTest(r, f, i, j))
X				continue;
X		if (b[i][j] == piece) {
X			*rank = i;
X			*file = j;
X			return (int) True;
X		}
X	}
X
X	for (i = r + 1, j = f - 1;; i++, j--) {
X		if ((i >= BOARD_SIZE) || (j < 0))
X			break;
X		if (isalpha(constraint) && (j != A_I(constraint)))
X			continue;
X		if (isdigit(constraint) && (j != (constraint - '1')))
X			continue;
X		if ((b[i][j] != EmptySquare) && (b[i][j] != piece))
X			break;
X		if (recurse)
X			if (CheckTest(r, f, i, j))
X				continue;
X		if (b[i][j] == piece) {
X			*rank = i;
X			*file = j;
X			return (int) True;
X		}
X	}
X
X	for (i = r - 1, j = f + 1;; i--, j++) {
X		if ((i < 0) || (j >= BOARD_SIZE))
X			break;
X		if (isalpha(constraint) && (j != A_I(constraint)))
X			continue;
X		if (isdigit(constraint) && (j != (constraint - '1')))
X			continue;
X		if ((b[i][j] != EmptySquare) && (b[i][j] != piece))
X			break;
X		if (recurse)
X			if (CheckTest(r, f, i, j))
X				continue;
X		if (b[i][j] == piece) {
X			*rank = i;
X			*file = j;
X			return (int) True;
X		}
X	}
X
X	for (i = r - 1, j = f - 1;; i--, j--) {
X		if ((i < 0) || (j < 0))
X			break;
X		if (isalpha(constraint) && (j != A_I(constraint)))
X			continue;
X		if (isdigit(constraint) && (j != (constraint - '1')))
X			continue;
X		if ((b[i][j] != EmptySquare) && (b[i][j] != piece))
X			break;
X		if (recurse)
X			if (CheckTest(r, f, i, j))
X				continue;
X		if (b[i][j] == piece) {
X			*rank = i;
X			*file = j;
X			return (int) True;
X		}
X	}
X
X	return (int) False;
}
X
static int
CheckTest(rt, ft, rf, ff)
X	int rt, ft, rf, ff;
{
X	int rk, fk, rank, file;
X	Board b;
X
X	CopyBoard(b, boards[currentMove]);
X	b[rt][ft] = b[rf][ff];
X	b[rf][ff] = EmptySquare;
X
X	/*
X	 * the bad move must have uncovered check by a rook, bishop or queen.
X	 */
X	if (WHITE_ON_MOVE) {				/* Is the white king in check? */
X		for (rk = 0; rk < BOARD_SIZE; rk++) {
X			for (fk = 0; fk < BOARD_SIZE; fk++) {
X				if (b[rk][fk] == WhiteKing) {
X					rank = rk; file = fk;
X					if (BishopSearch(&rank, &file, BlackBishop,
X						b, (int) False, NO_CONSTRAINT))
X						return (int) True;
X					rank = rk; file = fk;
X					if (RookSearch(&rank, &file, BlackRook,
X						b, (int) False, NO_CONSTRAINT))
X						return (int) True;
X					rank = rk; file = fk;
X					if (BishopSearch(&rank, &file, BlackQueen,
X						b, (int) False, NO_CONSTRAINT))
X						return (int) True;
X					rank = rk; file = fk;
X					if (RookSearch(&rank, &file, BlackQueen,
X						b, (int) False, NO_CONSTRAINT))
X						return (int) True;
X					return (int) False;
X				}
X			}
X		}
X	} else {							/* Is the black king in check? */
X		for (rk = 0; rk < BOARD_SIZE; rk++) {
X			for (fk = 0; fk < BOARD_SIZE; fk++) {
X				if (b[rk][fk] == BlackKing) {
X					rank = rk; file = fk;
X					if (BishopSearch(&rank, &file, WhiteBishop,
X						b, (int) False, NO_CONSTRAINT))
X						return (int) True;
X					rank = rk; file = fk;
X					if (RookSearch(&rank, &file, WhiteRook,
X						b, (int) False, NO_CONSTRAINT))
X						return (int) True;
X					rank = rk; file = fk;
X					if (BishopSearch(&rank, &file, WhiteQueen,
X						b, (int) False, NO_CONSTRAINT))
X						return (int) True;
X					rank = rk; file = fk;
X					if (RookSearch(&rank, &file, WhiteQueen,
X						b, (int) False, NO_CONSTRAINT))
X						return (int) True;
X					return (int) False;
X				}
X			}
X		}
X	}
X
X	return (int) False;
}
X
static int
yywrap()
{
X	return (int) True;
}
X
static int
input()
{
X	if (feof(gameFileFP))
X		return 0;
X	else
X		return fgetc(gameFileFP);
}
SHAR_EOF
chmod 0644 xboard/parser.l ||
echo 'restore of xboard/parser.l failed'
Wc_c="`wc -c < 'xboard/parser.l'`"
test 19769 -eq "$Wc_c" ||
	echo 'xboard/parser.l: original size 19769, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= xboard/match ==============
if test -f 'xboard/match' -a X"$1" != X"-c"; then
	echo 'x - skipping xboard/match (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting xboard/match (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'xboard/match' &&
#!/bin/sh
#
# match -- play a series of games using xboard as a referee
#
X
case $# in
8) COUNT=0; HOST1=$2 ; HOST2=$4 ; LENGTH=$6 ; MODE=$8 ;;
*) echo "Usage: match -host1 host -host2 host -length \
games -mode (Init | Position | Opening)" ; exit
esac
X
while (:)
do
X    if (test $COUNT -eq $LENGTH)
X    then
X        break
X    else
X        COUNT=`echo $COUNT | awk '{print $0 + 1}'`
X        MODULO=`echo $COUNT | awk '{print $0 % 2}'`
X        if (test $MODULO -eq 0)
X        then
X            xboard -iconic -firstHost $HOST1 -secondHost $HOST2 \
X                -matchMode $MODE -saveGameFile match.game.$COUNT \
X                -savePositionFile match.position.$COUNT
X        else
X            xboard -iconic -firstHost $HOST2 -secondHost $HOST1 \
X                -matchMode $MODE -saveGameFile match.game.$COUNT \
X                -savePositionFile match.position.$COUNT
X        fi
X    fi
done
SHAR_EOF
chmod 0755 xboard/match ||
echo 'restore of xboard/match failed'
Wc_c="`wc -c < 'xboard/match'`"
test 893 -eq "$Wc_c" ||
	echo 'xboard/match: original size 893, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= xboard/TODO ==============
if test -f 'xboard/TODO' -a X"$1" != X"-c"; then
	echo 'x - skipping xboard/TODO (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting xboard/TODO (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'xboard/TODO' &&
2. add more gnuchess switches
3. human-human playing
4. xor piece while user moves it
5. gray background for dark squares in 1-bit mode
6. alternate promotion code
7. positions assume that White is on move
8. slow down TwoMachines mode
9. manual position setup
10. add time odds to record-file
12. analog clocks, scoresheet text widget, jail
13. -iconic doesn't work correctly
14. indicator for force moves mode
SHAR_EOF
chmod 0644 xboard/TODO ||
echo 'restore of xboard/TODO failed'
Wc_c="`wc -c < 'xboard/TODO'`"
test 412 -eq "$Wc_c" ||
	echo 'xboard/TODO: original size 412, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= xboard/README ==============
if test -f 'xboard/README' -a X"$1" != X"-c"; then
	echo 'x - skipping xboard/README (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting xboard/README (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'xboard/README' &&
XXBoard Version 1.2
X
Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts.
X
All Rights Reserved
X
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
X
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
X
XXBoard is an X11/R4-based user interface for GNU Chess.  It uses the R4 Athena
widgets and Xt Intrinsics to provide an interactive referee for managing
a chess game between a user and a computer opponent or between two computers.
You can also use XBoard without a chess program to play through games in files
or to play through games manually (force mode).  In this case, moves aren't
validated by XBoard.  XBoard manages a digital chess clock for each player
and resets the clocks if time control is achieved within a given number of
moves.  A game can be started with the initial chess position, with a series
of moves from a game file or with a position from a position file.  The "match"
shell script runs a series of games between two machines, alternating sides.
The man page xboard.1 describes the features of XBoard.
X
XXBoard was written by Dan Sears and Chris Sears.  XBoard borrows its colors,
icon and piece bitmaps from xchess which was written and copyrighted by
Wayne Christopher.  We thank him for his work on XChess.
X
X
CAVEATS
X
XXBoard depends on the R4 Xt Intrinsics and R4 Athena Widget Set.  R3 won't do.
XXBoard works best with the version 3.1+ of gnuchess.  There has been one patch
and it is necessary.  This release of gnuchess was dated: Mon Apr 15 10:20 1991
by Mike McGann and should be available from comp.sources.misc archives.
GNU Chess must be compiled with the -DCHESSTOOL option for use with XBoard.
X
gnuchess version 3.1+ is available on gatekeeper.dec.com
in /pub/comp.sources.misc/volume19/gnuchess
X
If you DO NOT have the 3.1+ version of gnuchess then you MUST add the following
to your .Xdefaults file:
X
XXBoard*whiteString:                     white\n
XXBoard*blackString:                     black\n
X
X
CHANGES
X
Version 1.1 -- Mon Jan  7 14:46:03 PST 1991
X
X  - Fixed a bug in HandleUserMove() where the user could make a move while the
X    machine was thinking.  The fix detects and ignores these moves.  onMove
X    was not being used and was removed.
X
X  - Substantially rewrote and simplified the clock code.  If a game was paused
X    and then resumed, the clocks were out of sync.
X
X  - Konstantinos Konstantinides added the -searchTime option.
X
X  - Rewrote TwoMachinesPlay mode.
X
X  - Rewrote DisplayClocks().
X
X  - Hal Peterson contributed a new Imakefile.
X
X  - Added a declaration, xtVersion, which will quickly break on R3 Intrinsics.
X
X  - For people who don't like or use chess clocks a clockMode switch
X    has been added.  It is on by default.  It can be turned off in the
X    .Xdefaults file with
X
X        XBoard.clockMode:    False
X
X  - Detect if the visual doesn't support color.  If so, run in monoMode.
X    An alternative would be to detect grayscale visual and use a collection
X    of gray user interface colors.
X
X  - Works with gcc now.  gcc complained about casting float constants
X    as XtPointers.
X
X  - Added keyboard equivalents.  Added an iconify keystroke, C or c.
X
X  - Added StrStr() because many systems don't have this ANSI function.
X
X  - Substantially rewrote and simplified the Two Machine code.
X
X  - The bitmaps have been pushed into the bitmaps directory.
X
X  - Fixed a bug where a player could play after a game had been finished.
X
X  - Fixed a bug where hint didn't work.  The local version of gnuchessr
X    had been hacked.  The fix was to clone stderr and stdout for gnuchessr.
X
X  - Kayvan Sylvan contributed a patch for ESIX.
X    It seems that select() on pipes is broken on his system.  We declined
X    to incorporate his patch though, because it was a work-around for
X    something that was broken on one system, and selfishly, that system
X    was not my own.  Nevertheless, it is likely that other System V users
X    on PC's may need to use this patch and it is is included as the file
X    ESIX.patch.  To use it, type
X
X        patch xboard.c ESIX.patch
X
X  - Any button restarts a paused game.
X
X  - Warning messages get displayed in the message box.
X
X  - getlogin() does not work in all cases.
X    It was replaced by getpwuid(getuid())->pw_name).
X
X  - For systems with smaller screens, XBoard can use smaller pieces,
X    and a smaller board.  -bigSizeMode False uses a smaller set of pieces.
X    These are scaled versions of the large pieces.  They look ok but could
X    be improved.
X
X  - -iconic doesn't work properly.  If XBoard is opened iconic then
X    iconifying it later with a keystroke doesn't work.  I think
X    this is an Xt bug.
X
X  - the remoteShell resource was added for HP-UX systems
X    and other systems where the remoteShell isn't rsh.
X
X  - older non-ANSI versions of Sun compilers complain vociferously.
X
X  - Roger Dubar, Konstantinos Konstantinides, Wolfgang S. Rupprecht,
X    Paul Scowen, Mvh Smidt and Kayvan Sylvan all helped immensely during
X    beta-testing.
X
Version 1.2 -- Tue Jun 11 17:14:12 PDT 1991
X
X  - Added a lex parser for algebraic games.  It should be easy to use the parser
X    for other interfaces such as the Microsoft Windows version.
X    It parses comments of the form [anything] and ! to the end of a line.
X
X  - Corrected the queening code.  XBoard was sending the wrong syntax.
X    It was sending for example h8(Q) when it should have been sending h8q.
X    Thanks to Paul Vaughan and Mike McGann for pointing this out.
X
X  - Moved the man page from xboard.1 to xboard.man.  This makes imake man page
X    installs work correctly.  Thanks to Richard K. Lloyd for pointing this out.
X
X  - Changed the forwards/backwards/readgamefile code to allow a play to step
X    back and forth in a game.  If he steps all the way to the beginning
X    he has to restart the game.  If he gets into a mated position, same problem.
X
X  - Modified the code to use the R4 routines rather than R3 compatibility.
X
X  - Added a PopUp dialog for getting file names.
X
X  - If the first character of the file is not `1' then the first line
X    of a game or position file is displayed as the name in a label widget.
X
X  - Minor hacks to work with R5 alpha.  Had to add an event handler to the
X    boardWidget to get translations to work.  This may go away with the real R5.
X    Added <Message>WM_PROTOCOLS: QuitProc() for R5 ICCCM compatibility.
X
X  - If the DisplayWidth or DisplayHeight is less than 800, use small size mode.
X    Also the size of the name widget was reduced from 500 pixels to 400 pixels
X    because in small size mode there was a gap on the right.
X    Changed the default font from fixed to helvetica_oblique14 to:
X        -*-helvetica-bold-r-normal--14-*-*-*-*-*-*-*
X    helvetica_oblique14 is a font alias not on all R4 systems.
X    Curiously enough, the 17 point is not available on 75dpi systems
X    and the 18 point font is not available on 100dpi systems.
X    Thanks to Richard K. Lloyd for pointing these out.
X
X  - Fixed a compiler warning for gcc and an error for the IBM RT compilers.
X    This is the VOID_PROC macro in xboard.h.  Thanks to David Jensen for this.
X
X  - -iconic doesn't work at all now.  The Iconify() does work.  This was
X    a tradeoff and it is really an Xt bug.
X
X  - fixed a problem with the new version of gnuchessr where xboard wasn't
X    getting gnuchessr error messages for illegal moves.  The problem seems
X    to be fixed *without* any gnuchess changes but this is likely to be
X    highly system dependant.  There should be a new line on line 246 of nondsp.c
X
X        printz ("Illegal move (no matching move generated)");
X
X    The xboard fix was to set non-blocking i/o on the read pipe for gnuchessr
X
X        fcntl(from_prog[0], F_SETFL, O_NDELAY);
X
X  - The bitmap file names were changed so that none exceeded 14 characters.
X    This is necessary for R5.
X
X  - Added the CHESSDIR environment variable.  Game and position files are
X    found in this directory.  If this variable is not declared, then the
X    current directory is used.  File names starting with / are treated
X    specially.
X
X  - Fixed a bug where saving a long game, resetting and saving a short game
X    resulted in appending the end of the long game to the short one.
X    If a game is just being played out and there is no reason for gnuchessr
X    to be used, ignore pipe signals.  This allows people to use xboard
X    as a chess board without need for gnuchess.  Also, trivially bad moves
X    such as e2e2 are not passed on to gnuchessr but instead ignored out of
X    hand.  This allows people using xboard as a chessboard with gnuchessr
X    to pick a piece up, think and put it back down without making a move.
X    Thanks to Jeff Kenton for pointing these out.
X
X  - Fixed a bug where the checkmate message wasn't being parsed and xboard
X    kept playing.  Also, the message was added to game file if saved.
X    Thanks to Scott Hemhill for pointing this out.
X
X  - enumerations are not really integers on some C compilers.  I added casting.
X    The new version of gnuchess expects the "go" command for two machine
X    and machine plays white cases.  The whiteString resource is for
X    compatibility with previous gnuchess versions which get confused by go.
X    Thanks to Martin D. for catching these.
X
X  - There was an off by one error with the clock resetting code.  Also,
X    the clock display highliting was wrong.  Thanks to Bill Shauck for
X    pointing these out.
X
X  - Changed the protocol that xboard uses to work with the new version of
X    gnuchessr.
X
X  - Turned off the easy mode.
X
X  - For version 1.2, Jeff Kenton, Richard LLoyd, David Jensen, Martin D.,
X    Bill Schmidt, Scott Hemphill, Paul Vaughan and Bill Shauck all found
X    a lot of bugs that we put into xboard just to see if they were paying
X    attention.  They were.
SHAR_EOF
chmod 0644 xboard/README ||
echo 'restore of xboard/README failed'
Wc_c="`wc -c < 'xboard/README'`"
test 10539 -eq "$Wc_c" ||
	echo 'xboard/README: original size 10539, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= xboard/Imakefile ==============
if test -f 'xboard/Imakefile' -a X"$1" != X"-c"; then
	echo 'x - skipping xboard/Imakefile (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting xboard/Imakefile (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'xboard/Imakefile' &&
#
# Imakefile -- to generate a Makefile for xboard, use:
#   /usr/local/X11/mit/config/imake \
#       -I/usr/local/X11/mit/config \
#       -DTOPDIR=/usr/local/X11/mit
#
X
X   SYS_LIBRARIES = -lm
X LOCAL_LIBRARIES = XawClientLibs
X         DEPLIBS = XawClientDepLibs
X
SRCS = parser.c xboard.c
OBJS = parser.o xboard.o
X
AllTarget(xboard)
X
depend:: parser.c
X
clean::
X	$(RM) parser.c
X
ComplexProgramTarget(xboard)
SHAR_EOF
chmod 0644 xboard/Imakefile ||
echo 'restore of xboard/Imakefile failed'
Wc_c="`wc -c < 'xboard/Imakefile'`"
test 408 -eq "$Wc_c" ||
	echo 'xboard/Imakefile: original size 408, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= xboard/bitmaps/k_sm_ol.bm ==============
if test ! -d 'xboard/bitmaps'; then
    echo 'x - creating directory xboard/bitmaps'
    mkdir 'xboard/bitmaps'
fi
if test -f 'xboard/bitmaps/k_sm_ol.bm' -a X"$1" != X"-c"; then
	echo 'x - skipping xboard/bitmaps/k_sm_ol.bm (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting xboard/bitmaps/k_sm_ol.bm (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'xboard/bitmaps/k_sm_ol.bm' &&
#define king_small_outline_width 64
#define king_small_outline_height 64
static char king_small_outline_bits[] = {
X 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0xc0,0x03,0x00,0x00,
X 0x00,0x01,0x00,0x00,0x60,0x0c,0x00,0x00,0x00,0x01,0x00,0x00,0x20,0x08,0x00,
X 0x00,0x00,0x01,0x00,0x00,0x20,0x08,0x00,0x00,0x00,0x01,0x00,0x00,0x60,0x0c,
X 0x00,0x00,0x00,0x01,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x70,
X 0x1c,0x00,0x00,0x00,0x01,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x01,0xff,0x01,
X 0x18,0x30,0xc0,0xff,0x00,0x81,0x00,0x06,0x88,0x23,0x30,0x00,0x01,0x41,0x00,
X 0x1c,0x48,0x22,0x1c,0x00,0x02,0x21,0x00,0x30,0x48,0x20,0x04,0x00,0x04,0x11,
X 0x00,0x40,0xc8,0x22,0x02,0x38,0x08,0x19,0x0c,0x83,0x99,0xb3,0x81,0xc0,0x18,
X 0x09,0x02,0x0c,0x13,0x90,0x30,0x80,0x18,0x09,0x03,0x18,0x12,0xd0,0x18,0x80,
X 0x11,0x0d,0x01,0x10,0x94,0x53,0x00,0x00,0x31,0x85,0x00,0x20,0x7c,0x3e,0x04,
X 0x00,0x23,0x85,0x00,0x40,0x30,0x0c,0x04,0x00,0x22,0x85,0x00,0xc0,0x00,0x00,
X 0x02,0x1c,0x22,0xc1,0x38,0x80,0x00,0x01,0x41,0x1c,0x02,0x41,0x38,0x08,0x81,
X 0x83,0x41,0x1c,0x02,0x41,0x78,0x04,0x81,0x83,0x40,0x04,0x02,0x45,0x40,0x04,
X 0x02,0x41,0x40,0x02,0x22,0x45,0xc0,0x00,0x02,0x40,0x40,0x13,0x22,0x45,0x88,
X 0x00,0x00,0x00,0x40,0x0f,0x23,0x45,0xb8,0x01,0x04,0x00,0xc0,0x05,0x21,0x05,
X 0xe0,0x03,0x04,0x21,0xc0,0x03,0x21,0x89,0x80,0x03,0x8c,0x23,0xc0,0x01,0x31,
X 0x89,0x00,0x02,0x88,0x23,0xc0,0x80,0x11,0x89,0x01,0x02,0x08,0x21,0x40,0x80,
X 0x10,0x09,0x01,0x04,0x18,0x10,0x20,0x80,0x18,0x19,0x03,0x0c,0x10,0x10,0x20,
X 0x80,0x18,0x11,0x02,0x08,0x10,0x10,0x30,0x80,0x08,0x11,0x02,0x08,0x10,0x10,
X 0x10,0x40,0x08,0x21,0x04,0x18,0x00,0x09,0x10,0x40,0x04,0x21,0x04,0x10,0x20,
X 0x09,0x18,0x00,0x04,0x41,0x0c,0x30,0x20,0x08,0x08,0x20,0x02,0x41,0x08,0x20,
X 0x20,0x08,0x04,0x30,0x03,0x81,0x10,0x20,0x20,0x08,0x00,0x08,0x01,0x81,0x30,
X 0x00,0x20,0x08,0x00,0x8c,0x01,0x01,0x21,0x00,0x20,0x08,0x00,0xc4,0x00,0x01,
X 0x02,0xf8,0x3f,0xf8,0x1f,0x42,0x00,0x01,0xc4,0x0f,0x00,0x00,0xf0,0x23,0x00,
X 0x01,0x00,0x00,0x11,0x11,0x01,0x10,0x00,0x01,0x10,0x10,0x11,0x11,0x11,0x08,
X 0x00,0x01,0xa0,0x11,0x00,0x00,0x90,0x01,0x00,0x01,0x00,0x01,0xfe,0xff,0x00,
X 0x05,0x00,0x01,0x00,0xf0,0x03,0x00,0x1f,0x04,0x00,0x01,0x00,0x00,0xc0,0x07,
X 0x00,0x00,0x00,0x01,0x80,0x03,0xf0,0x0f,0xc0,0x01,0x00,0x01,0x80,0x07,0xc0,
X 0x07,0xe0,0x01,0x00,0x01,0x80,0x0f,0x00,0x01,0xf0,0x01,0x00,0x01,0x80,0x03,
X 0xfc,0xff,0xc0,0x01,0x00,0x01,0x00,0xe0,0x07,0x80,0x1f,0x00,0x00,0x01,0x00,
X 0x3f,0x00,0x00,0xf0,0x00,0x00,0x01,0x40,0x00,0x00,0x00,0x00,0x02,0x00,0x01,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00};
SHAR_EOF
chmod 0644 xboard/bitmaps/k_sm_ol.bm ||
echo 'restore of xboard/bitmaps/k_sm_ol.bm failed'
Wc_c="`wc -c < 'xboard/bitmaps/k_sm_ol.bm'`"
test 2746 -eq "$Wc_c" ||
	echo 'xboard/bitmaps/k_sm_ol.bm: original size 2746, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= xboard/bitmaps/ol_p.bm ==============
if test -f 'xboard/bitmaps/ol_p.bm' -a X"$1" != X"-c"; then
	echo 'x - skipping xboard/bitmaps/ol_p.bm (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting xboard/bitmaps/ol_p.bm (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'xboard/bitmaps/ol_p.bm' &&
#define outline_pawn_width 80
#define outline_pawn_height 80
static char outline_pawn_bits[] = {
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x70,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x18, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
X   0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x80, 0x01, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0xe0, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
X   0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x03, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0e, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0xe0, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
X   0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
X   0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
X   0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x03, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00,
X   0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x20, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
X   0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
X   0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
X   0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
X   0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
X   0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
X   0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x80, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
X   0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
X   0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x30, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x18, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x06, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
X   0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0xff, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x78, 0xc0, 0x81, 0x07, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x07, 0xc0, 0x7f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00,
X   0x80, 0x01, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
X   0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
X   0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
X   0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
X   0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x18, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
SHAR_EOF
chmod 0644 xboard/bitmaps/ol_p.bm ||
echo 'restore of xboard/bitmaps/ol_p.bm failed'
Wc_c="`wc -c < 'xboard/bitmaps/ol_p.bm'`"
test 5099 -eq "$Wc_c" ||
	echo 'xboard/bitmaps/ol_p.bm: original size 5099, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= xboard/bitmaps/ol_q.bm ==============
if test -f 'xboard/bitmaps/ol_q.bm' -a X"$1" != X"-c"; then
	echo 'x - skipping xboard/bitmaps/ol_q.bm (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting xboard/bitmaps/ol_q.bm (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'xboard/bitmaps/ol_q.bm' &&
#define outline_queen_width 80
#define outline_queen_height 80
static char outline_queen_bits[] = {
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x03, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x60, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x80, 0x01,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x01, 0x80, 0x01, 0x00, 0x07,
X   0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0x80, 0x01, 0x80, 0x0d, 0x00, 0x00,
X   0x00, 0x00, 0xb0, 0x01, 0xc0, 0x03, 0x80, 0x08, 0x00, 0x00, 0x00, 0x00,
X   0xe0, 0x00, 0x40, 0x02, 0x80, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
X   0x40, 0x02, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x02,
X   0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x02, 0x00, 0x03,
X   0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x02, 0x00, 0x03, 0x00, 0x00,
X   0x00, 0x00, 0xc0, 0x01, 0x40, 0x02, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00,
X   0x40, 0x01, 0x40, 0x02, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01,
X   0x60, 0x06, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x40, 0x03, 0x20, 0x04,
X   0xc0, 0x02, 0x00, 0x00, 0x1c, 0x00, 0x40, 0x02, 0x20, 0x04, 0x40, 0x02,
X   0x00, 0x00, 0x36, 0x00, 0x40, 0x02, 0x20, 0x04, 0x40, 0x02, 0x00, 0x0e,
X   0x22, 0x00, 0x40, 0x06, 0x20, 0x04, 0x60, 0x02, 0x00, 0x1b, 0x36, 0x00,
X   0x40, 0x04, 0x20, 0x04, 0x20, 0x02, 0x00, 0x11, 0x3c, 0x00, 0x40, 0x04,
X   0x20, 0x04, 0x20, 0x02, 0x00, 0x1b, 0x70, 0x00, 0x40, 0x0c, 0x20, 0x04,
X   0x30, 0x02, 0x00, 0x0e, 0x60, 0x00, 0x40, 0x08, 0x20, 0x04, 0x10, 0x02,
X   0x00, 0x03, 0xe0, 0x00, 0x40, 0x08, 0x30, 0x0c, 0x10, 0x02, 0x80, 0x03,
X   0xc0, 0x01, 0x40, 0x18, 0x10, 0x08, 0x18, 0x02, 0x80, 0x01, 0x40, 0x01,
X   0x40, 0x10, 0x10, 0x08, 0x08, 0x02, 0xc0, 0x01, 0x40, 0x03, 0x40, 0x10,
X   0x10, 0x08, 0x08, 0x02, 0x60, 0x01, 0x40, 0x06, 0x40, 0x10, 0x10, 0x08,
X   0x08, 0x02, 0x20, 0x01, 0x40, 0x04, 0x40, 0x30, 0x10, 0x08, 0x0c, 0x02,
X   0x30, 0x01, 0xc0, 0x0c, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x18, 0x01,
X   0x80, 0x18, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x08, 0x01, 0x80, 0x10,
SHAR_EOF
true || echo 'restore of xboard/bitmaps/ol_q.bm failed'
fi
echo 'End of  part 3'
echo 'File xboard/bitmaps/ol_q.bm is continued in part 4'
echo 4 > _shar_seq_.tmp
exit 0

--
Dan Heller
O'Reilly && Associates       Z-Code Software    Comp-sources-x:
Senior Writer                President          comp-sources-x at uunet.uu.net
argv at ora.com                 argv at zipcode.com



More information about the Comp.sources.x mailing list