games-request@tekred.TEK.COM (01/19/88)
Submitted by: faustus@ic.berkeley.edu (Wayne A. Christopher) Comp.sources.games: Volume 3, Issue 45 Archive-name: xchess/Part04 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 4 (of 6)." # Contents: bishop_outline.bitmap board.c clock.c king_outline.bitmap # knight_mask.bitmap knight_outline.bitmap pawn_outline.bitmap # queen_outline.bitmap rook_outline.bitmap xchess.1 xchess.c # xchess_mask.cur # Wrapped by billr@tekred on Mon Jan 18 08:48:15 1988 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f bishop_outline.bitmap -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"bishop_outline.bitmap\" else echo shar: Extracting \"bishop_outline.bitmap\" \(4485 characters\) sed "s/^X//" >bishop_outline.bitmap <<'END_OF_bishop_outline.bitmap' X/* This file contains code for X-CHESS. X Copyright (C) 1986 Free Software Foundation, Inc. X XThis file is part of X-CHESS. X XX-CHESS is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY. No author or distributor Xaccepts responsibility to anyone for the consequences of using it Xor for whether it serves any particular purpose or works at all, Xunless he says so in writing. Refer to the X-CHESS General Public XLicense for full details. X XEveryone is granted permission to copy, modify and redistribute XX-CHESS, but only under the conditions described in the XX-CHESS General Public License. A copy of this license is Xsupposed to have been given to you along with X-CHESS so you Xcan know your rights and responsibilities. It should be in a Xfile named COPYING. Among other things, the copyright notice Xand this notice must be preserved on all copies. */ X X#define bishop_outline_width 80 X#define bishop_outline_height 80 Xstatic short bishop_outline_bits[] = { X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0700, 0x0007, 0x0000, 0x0000, X 0x0000, 0x8d80, 0x000d, 0x0000, X 0x0000, 0x0000, 0x8880, 0x0008, X 0x0000, 0x0000, 0x0000, 0x8d80, X 0x000d, 0x0000, 0x0000, 0x0000, X 0x0700, 0x0007, 0x0000, 0x0000, X 0x0000, 0x0200, 0x0002, 0x0000, X 0x0000, 0x0000, 0x0f80, 0x0005, X 0x0000, 0x0000, 0x0000, 0x98c0, X 0x0008, 0x0000, 0x0000, 0x0000, X 0x7060, 0x0010, 0x0000, 0x0000, X 0x0000, 0x4030, 0x0010, 0x0000, X 0x0000, 0x0000, 0xc018, 0x0010, X 0x0000, 0x0000, 0x0000, 0x8008, X 0x0030, 0x0000, 0x0000, 0x0000, X 0x800c, 0x0021, 0x0000, 0x0000, X 0x0000, 0x8006, 0x0023, 0x0000, X 0x0000, 0x0000, 0x0002, 0x0022, X 0x0000, 0x0000, 0x0000, 0x0703, X 0x0066, 0x0000, 0x0000, 0x0000, X 0x0501, 0x0044, 0x0000, 0x0000, X 0x8000, 0x0501, 0x004c, 0x0000, X 0x0000, 0x8000, 0x3de0, 0x0048, X 0x0000, 0x0000, 0xc000, 0x2020, X 0x0058, 0x0000, 0x0000, 0x4000, X 0x3de0, 0x0050, 0x0000, 0x0000, X 0x6000, 0x0500, 0x0070, 0x0000, X 0x0000, 0x2000, 0x0500, 0x0040, X 0x0000, 0x0000, 0x2000, 0x0500, X 0x0040, 0x0000, 0x0000, 0x2000, X 0x0500, 0x0040, 0x0000, 0x0000, X 0x3000, 0x0500, 0x0040, 0x0000, X 0x0000, 0x1000, 0x0500, 0x0040, X 0x0000, 0x0000, 0x1000, 0x0700, X 0x00c0, 0x0000, 0x0000, 0x1800, X 0x0000, 0x0080, 0x0000, 0x0000, X 0x0800, 0x0000, 0x0080, 0x0000, X 0x0000, 0x0800, 0x0000, 0x0080, X 0x0000, 0x0000, 0x0800, 0x0000, X 0x0080, 0x0000, 0x0000, 0x1800, X 0x0000, 0x00c0, 0x0000, 0x0000, X 0x1000, 0x0000, 0x0040, 0x0000, X 0x0000, 0x1000, 0x0000, 0x0040, X 0x0000, 0x0000, 0x1000, 0x0000, X 0x0040, 0x0000, 0x0000, 0x3000, X 0x0000, 0x0060, 0x0000, 0x0000, X 0x2000, 0x0000, 0x0020, 0x0000, X 0x0000, 0x6000, 0x0000, 0x0030, X 0x0000, 0x0000, 0x4000, 0x0000, X 0x0010, 0x0000, 0x0000, 0xc000, X 0x0000, 0x0018, 0x0000, 0x0000, X 0x8000, 0x0000, 0x0008, 0x0000, X 0x0000, 0x8000, 0x0000, 0x0008, X 0x0000, 0x0000, 0x8000, 0x0001, X 0x000c, 0x0000, 0x0000, 0x0000, X 0xffff, 0x0007, 0x0000, 0x0000, X 0x0000, 0x0001, 0x0004, 0x0000, X 0x0000, 0x0000, 0x0001, 0x0004, X 0x0000, 0x0000, 0x0000, 0xffff, X 0x0007, 0x0000, 0x0000, 0x0000, X 0x0202, 0x0002, 0x0000, 0x0000, X 0x0000, 0x0706, 0x0003, 0x0000, X 0x0000, 0x0000, 0x8d8e, 0x0003, X 0x0000, 0x0000, 0x0000, 0x8d8e, X 0x0003, 0x0000, 0x0000, 0x0000, X 0x0706, 0x0003, 0x0000, 0x0000, X 0x0000, 0x0202, 0x0006, 0x0000, X 0x0000, 0x0000, 0xffff, 0x0007, X 0x0000, 0x0000, 0x0000, 0x0001, X 0x0004, 0x0000, 0x0000, 0x0000, X 0x0001, 0x0004, 0x0000, 0x0000, X 0x8000, 0x0001, 0x000c, 0x0000, X 0x0000, 0x8000, 0x0000, 0x0008, X 0x0000, 0x0000, 0xc000, 0xffff, X 0x001f, 0x0000, 0x0000, 0x0000, X 0x0880, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0880, 0x0000, 0x0000, X 0x0000, 0x0000, 0x18c0, 0x0000, X 0x0000, 0x0000, 0x0000, 0x3060, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x6030, 0x0000, 0x0000, 0x0000, X 0x0000, 0xc718, 0x0000, 0x0000, X 0x0000, 0x1ff8, 0x850c, 0xffc1, X 0x0001, 0x0000, 0xf00e, 0x0d87, X 0x007f, 0x0007, 0xc000, 0x0003, X 0x08c0, 0x0000, 0x003c, 0x7000, X 0x0000, 0x18e0, 0x0000, 0x00e0, X 0xc000, 0x1ff8, 0x7038, 0xffc0, X 0x0031, 0x8000, 0xf00f, 0xc00f, X 0x007f, 0x001f, 0xc000, 0x0000, X 0x0000, 0x0000, 0x0030, 0x6000, X 0x0000, 0x0000, 0x0000, 0x0060, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000}; END_OF_bishop_outline.bitmap if test 4485 -ne `wc -c <bishop_outline.bitmap`; then echo shar: \"bishop_outline.bitmap\" unpacked with wrong size! fi # end of overwriting check fi if test -f board.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"board.c\" else echo shar: Extracting \"board.c\" \(4650 characters\) sed "s/^X//" >board.c <<'END_OF_board.c' X/* This file contains code for X-CHESS. X Copyright (C) 1986 Free Software Foundation, Inc. X XThis file is part of X-CHESS. X XX-CHESS is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY. No author or distributor Xaccepts responsibility to anyone for the consequences of using it Xor for whether it serves any particular purpose or works at all, Xunless he says so in writing. Refer to the X-CHESS General Public XLicense for full details. X XEveryone is granted permission to copy, modify and redistribute XX-CHESS, but only under the conditions described in the XX-CHESS General Public License. A copy of this license is Xsupposed to have been given to you along with X-CHESS so you Xcan know your rights and responsibilities. It should be in a Xfile named COPYING. Among other things, the copyright notice Xand this notice must be preserved on all copies. */ X X X/* RCS Info: $Revision: 1.4 $ on $Date: 86/11/23 17:17:15 $ X * $Source: /users/faustus/xchess/RCS/board.c,v $ X * Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group X * Permission is granted to do anything with this code except sell it X * or remove this message. X * X * Stuff to deal with the board. X */ X X#include "xchess.h" X Xboard *chessboard; X Xvoid Xboard_setup() X{ X chessboard = alloc(board); X board_init(chessboard); X return; X} X Xvoid Xboard_init(b) X board *b; X{ X int i, j; X X for (i = 0; i < 2; i++) X for (j = 0; j < SIZE; j++) X b->square[i][j].color = BLACK; X for (i = 2; i < 6; i++) X for (j = 0; j < SIZE; j++) X b->square[i][j].color = NONE; X for (i = 6; i < 8; i++) X for (j = 0; j < SIZE; j++) X b->square[i][j].color = WHITE; X for (i = 0; i < SIZE; i++) X b->square[1][i].type = b->square[6][i].type = X PAWN; X b->square[0][0].type = b->square[7][0].type = ROOK; X b->square[0][1].type = b->square[7][1].type = KNIGHT; X b->square[0][2].type = b->square[7][2].type = BISHOP; X b->square[0][3].type = b->square[7][3].type = QUEEN; X b->square[0][4].type = b->square[7][4].type = KING; X b->square[0][5].type = b->square[7][5].type = BISHOP; X b->square[0][6].type = b->square[7][6].type = KNIGHT; X b->square[0][7].type = b->square[7][7].type = ROOK; X X return; X} X Xvoid Xboard_drawall() X{ X int i, j; X X for (i = 0; i < SIZE; i++) X for (j = 0; j < SIZE; j++) X if (chessboard->square[i][j].color != NONE) { X win_drawpiece(&chessboard->square[i][j], i, X j, WHITE); X if (!oneboard) X win_drawpiece(&chessboard->square[i][j], X i, j, BLACK); X } X return; X} X Xvoid Xboard_move(b, m) X board *b; X move *m; X{ X switch (m->type) { X X case MOVE: X case CAPTURE: X b->square[m->fromy][m->fromx].color = NONE; X b->square[m->toy][m->tox].color = m->piece.color; X b->square[m->toy][m->tox].type = m->piece.type; X if ((m->piece.type == PAWN) && (((m->piece.color == BLACK) && X (m->toy == 7)) || ((m->piece.color == WHITE) && X (m->toy == 0)))) X b->square[m->toy][m->tox].type = QUEEN; X if (m->enpassant) X b->square[m->toy + ((m->piece.color == WHITE) ? 1 : X -1)][m->tox].color = NONE; X break; X X case KCASTLE: X if (m->piece.color == WHITE) { X b->square[7][5].color = m->piece.color; X b->square[7][5].type = ROOK; X b->square[7][6].color = m->piece.color; X b->square[7][6].type = KING; X b->square[7][4].color = NONE; X b->square[7][7].color = NONE; X } else { X b->square[0][5].color = m->piece.color; X b->square[0][5].type = ROOK; X b->square[0][6].color = m->piece.color; X b->square[0][6].type = KING; X b->square[0][4].color = NONE; X b->square[0][7].color = NONE; X } X break; X X case QCASTLE: X if (m->piece.color == WHITE) { X b->square[7][3].color = m->piece.color; X b->square[7][3].type = ROOK; X b->square[7][2].color = m->piece.color; X b->square[7][2].type = KING; X b->square[7][4].color = NONE; X b->square[7][0].color = NONE; X } else { X b->square[0][3].color = m->piece.color; X b->square[0][3].type = ROOK; X b->square[0][2].color = m->piece.color; X b->square[0][2].type = KING; X b->square[0][4].color = NONE; X b->square[0][0].color = NONE; X } X break; X X default: X fprintf(stderr, "Bad move type %d\n", m->type); X } X X if (m->piece.type == KING) { X if (m->piece.color == WHITE) X b->white_cant_castle_q = X b->white_cant_castle_k= true; X else X b->black_cant_castle_q = X b->black_cant_castle_k= true; X } else if (m->piece.type == ROOK) { X if (m->piece.color == WHITE) { X if (m->fromx == 0) X b->white_cant_castle_q = true; X else if (m->fromx == 7) X b->white_cant_castle_k = true; X } else { X if (m->fromx == 0) X b->black_cant_castle_q = true; X else if (m->fromx == 7) X b->black_cant_castle_k = true; X } X } X X return; X} X END_OF_board.c if test 4650 -ne `wc -c <board.c`; then echo shar: \"board.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f clock.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"clock.c\" else echo shar: Extracting \"clock.c\" \(6086 characters\) sed "s/^X//" >clock.c <<'END_OF_clock.c' X/* This file contains code for X-CHESS. X Copyright (C) 1986 Free Software Foundation, Inc. X XThis file is part of X-CHESS. X XX-CHESS is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY. No author or distributor Xaccepts responsibility to anyone for the consequences of using it Xor for whether it serves any particular purpose or works at all, Xunless he says so in writing. Refer to the X-CHESS General Public XLicense for full details. X XEveryone is granted permission to copy, modify and redistribute XX-CHESS, but only under the conditions described in the XX-CHESS General Public License. A copy of this license is Xsupposed to have been given to you along with X-CHESS so you Xcan know your rights and responsibilities. It should be in a Xfile named COPYING. Among other things, the copyright notice Xand this notice must be preserved on all copies. */ X X X/* RCS Info: $Revision: 1.4 $ on $Date: 86/11/26 12:09:47 $ X * $Source: /users/faustus/xchess/RCS/clock.c,v $ X * Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group X * Permission is granted to do anything with this code except sell it X * or remove this message. X * X * Do stuff with the clocks. The way things work is as follows. We call X * clock_init to draw the clocks initially, but they don't actually start X * running until we call clock_switch for the first time. X */ X X#include "xchess.h" X Xint movesperunit = 0; Xint timeunit = 0; Xbool clock_started = false; Xint whiteseconds, blackseconds; X Xstatic bool white_running = true; Xstatic long lastwhite, lastblack; Xstatic bool firstmove = true; X Xextern void dohands(), hilight(); X X#define PI 3.1415926535897932384 X Xvoid Xclock_draw(win, col) X windata *win; X color col; X{ X int i; X char buf[BSIZE]; X int x = CLOCK_WIDTH / 2, y = CLOCK_WIDTH / 2; X int xp, yp; X int rad = CLOCK_WIDTH / 2 - 10; X Window w = ((col == WHITE) ? win->wclockwin : win->bclockwin); X X XSetDisplay(win->display); X /* Draw a clock face and the hands. */ X XCircle(w, x, y, rad, 0.0, 0.0, 1, 1, win->textcolor.pixel, GXcopy, X AllPlanes); X rad -= 8; X for (i = 1; i <= 12; i++) { X xp = x + rad * cos(PI * 3 / 2 + i * PI / 6) - 4; X yp = y + rad * sin(PI * 3 / 2 + i * PI / 6) - 5; X sprintf(buf, "%d", i); X XText(w, xp, yp, buf, strlen(buf), win->small->id, X win->textcolor.pixel, win->textback.pixel); X } X X dohands(win, col); X X if (white_running) { X hilight(win, WHITE, true); X hilight(win, BLACK, false); X } else { X hilight(win, WHITE, false); X hilight(win, BLACK, true); X } X return; X} X Xvoid Xclock_init(win, col) X windata *win; X color col; X{ X whiteseconds = blackseconds = 0; X clock_started = false; X firstmove = true; X clock_draw(win, col); X X return; X} X Xvoid Xclock_update() X{ X int now = time((long *) NULL); X int i; X X if (!clock_started) { X lastwhite = lastblack = now; X return; X } X X if (white_running) { X whiteseconds += now - lastwhite; X lastwhite = now; X dohands(win1, WHITE); X if (!oneboard) X dohands(win2, WHITE); X if (timeunit) { X i = whiteseconds / timeunit; X if ((i > 0) && (whiteseconds > i * timeunit) && X (whiteseconds < i * timeunit + 10) && X (movesperunit * i > movenum)) { X message_add(win1, X "White has exceeded his time limit\n", X true); X if (!oneboard) { X message_add(win2, X "White has exceeded his time limit\n", X true); X } X timeunit = 0; X } X } X } else { X blackseconds += now - lastblack; X lastblack = now; X dohands(win1, BLACK); X if (!oneboard) X dohands(win2, BLACK); X if (timeunit) { X i = blackseconds / timeunit; X if ((i > 0) && (blackseconds > i * timeunit) && X (blackseconds < i * timeunit + 10) && X (movesperunit * i > movenum)) { X message_add(win1, X "Black has exceeded his time limit\n", X true); X if (!oneboard) { X message_add(win2, X "Black has exceeded his time limit\n", X true); X } X timeunit = 0; X } X } X } X return; X} X Xvoid Xclock_switch() X{ X if (firstmove) { X clock_started = true; X firstmove = false; X lastwhite = lastblack = time((long *) NULL); X } X if (white_running) { X white_running = false; X lastblack = time((long *) NULL); X hilight(win1, WHITE, false); X hilight(win1, BLACK, true); X if (!oneboard) { X hilight(win2, WHITE, false); X hilight(win2, BLACK, true); X } X } else { X white_running = true; X lastwhite = time((long *) NULL); X hilight(win1, WHITE, true); X hilight(win1, BLACK, false); X if (!oneboard) { X hilight(win2, WHITE, true); X hilight(win2, BLACK, false); X } X } X return; X} X Xstatic void Xdohands(win, col) X windata *win; X color col; X{ X int cx = CLOCK_WIDTH / 2, cy = CLOCK_WIDTH / 2; X double *h = (col == WHITE) ? win->whitehands : win->blackhands; X Window w = (col == WHITE) ? win->wclockwin : win->bclockwin; X long secs = (col == WHITE) ? whiteseconds : blackseconds; X int rad, x, y, i; X X XSetDisplay(win->display); X X /* First erase the old hands. */ X rad = CLOCK_WIDTH / 2 - 30; X for (i = 0; i < 3; i++) { X x = cx + rad * sin(PI - h[i]); X y = cy + rad * cos(PI - h[i]); X XLine(w, cx, cy, x, y, i + 1, i + 1, win->textback.pixel, X GXcopy, AllPlanes); X rad -= 8; X } X X h[0] = (secs % 60) * 2 * PI / 60; X h[1] = ((secs / 60) % 60) * 2 * PI / 60; X h[2] = ((secs / 3600) % 12) * 2 * PI / 12; X X /* Now draw the new ones. */ X rad = CLOCK_WIDTH / 2 - 30; X for (i = 0; i < 3; i++) { X x = cx + rad * sin(PI - h[i]); X y = cy + rad * cos(PI - h[i]); X XLine(w, cx, cy, x, y, i + 1, i + 1, win->textcolor.pixel, X GXcopy, AllPlanes); X rad -= 8; X } X return; X} X Xstatic void Xhilight(win, col, on) X windata *win; X color col; X bool on; X{ X Window w = (col == WHITE) ? win->wclockwin : win->bclockwin; X char *s = (col == WHITE) ? " WHITE " : " BLACK "; X int x, y; X X XSetDisplay(win->display); X X x = XStringWidth(s, win->large, 0, 0); X XLine(w, 0, CLOCK_HEIGHT - 26, CLOCK_WIDTH, CLOCK_HEIGHT - 26, X BORDER_WIDTH, BORDER_WIDTH, win->border.pixel, GXcopy, X AllPlanes); X XText(w, (CLOCK_WIDTH - x) / 2, CLOCK_HEIGHT - 21, s, strlen(s), X win->large->id, on ? win->textback.pixel : X win->textcolor.pixel, on ? win->textcolor.pixel : X win->textback.pixel); X return; X} X END_OF_clock.c if test 6086 -ne `wc -c <clock.c`; then echo shar: \"clock.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f king_outline.bitmap -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"king_outline.bitmap\" else echo shar: Extracting \"king_outline.bitmap\" \(4479 characters\) sed "s/^X//" >king_outline.bitmap <<'END_OF_king_outline.bitmap' X/* This file contains code for X-CHESS. X Copyright (C) 1986 Free Software Foundation, Inc. X XThis file is part of X-CHESS. X XX-CHESS is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY. No author or distributor Xaccepts responsibility to anyone for the consequences of using it Xor for whether it serves any particular purpose or works at all, Xunless he says so in writing. Refer to the X-CHESS General Public XLicense for full details. X XEveryone is granted permission to copy, modify and redistribute XX-CHESS, but only under the conditions described in the XX-CHESS General Public License. A copy of this license is Xsupposed to have been given to you along with X-CHESS so you Xcan know your rights and responsibilities. It should be in a Xfile named COPYING. Among other things, the copyright notice Xand this notice must be preserved on all copies. */ X X#define king_outline_width 80 X#define king_outline_height 80 Xstatic short king_outline_bits[] = { X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x07c0, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0440, 0x0000, 0x0000, 0x0000, X 0x0000, 0x1c70, 0x0000, 0x0000, X 0x0000, 0x0000, 0x1010, 0x0000, X 0x0000, 0x0000, 0x0000, 0x1010, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x1c70, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0440, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0440, 0x0000, X 0x0000, 0x0000, 0x0000, 0x3c78, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x2008, 0x0000, 0x0000, 0xf800, X 0x001f, 0x600c, 0xfc00, 0x001f, X 0x0e00, 0x0070, 0x4384, 0x0700, X 0x0070, 0x0300, 0x00c0, 0x46c4, X 0x0180, 0x00c0, 0x0180, 0x0380, X 0x4444, 0x00e0, 0x0180, 0x00c0, X 0x0e00, 0x4444, 0x0030, 0x0300, X 0x0060, 0x1800, 0x4444, 0x0018, X 0x0607, 0xe020, 0x303f, 0x46c4, X 0xf80c, 0x041d, 0x3030, 0x6060, X 0x638c, 0x0c06, 0x0c30, 0x1810, X 0xc1c0, 0x2008, 0x0382, 0x0c20, X 0x0c10, 0x8300, 0x2009, 0x00c3, X 0x0860, 0x0418, 0x0200, 0xa38b, X 0x0041, 0x1840, 0x0608, 0x0600, X 0xb67a, 0x0020, 0x10c0, 0x0208, X 0x0c00, 0x7c3e, 0x0030, 0x1080, X 0x0208, 0x1800, 0x1818, 0x0010, X 0x1080, 0x020c, 0x3000, 0x0000, X 0xc018, 0x3083, 0xc304, 0x2003, X 0x0100, 0xc20c, 0x2083, 0xc104, X 0x6103, 0x0380, 0xc606, 0x2083, X 0xc104, 0x4183, 0x07c0, 0xc406, X 0x2083, 0xc104, 0xc087, 0x0380, X 0xc403, 0x2080, 0x010c, 0x8084, X 0x0100, 0x6401, 0x3080, 0x0108, X 0x8044, 0x8001, 0x2401, 0x1086, X 0x0108, 0x004c, 0x8001, 0x3400, X 0x1083, 0x6108, 0x0048, 0x8001, X 0xd400, 0x10c1, 0xc108, 0x0059, X 0x8003, 0x5c00, 0x1040, 0x0108, X 0x0057, 0xc102, 0x2c00, 0x1040, X 0x0218, 0x007c, 0x4382, 0x3c00, X 0x1840, 0x0210, 0x0070, 0x47c6, X 0x1c00, 0x1840, 0x0210, 0x0060, X 0x4384, 0x0e00, 0x0860, 0x0610, X 0x0040, 0x4104, 0x0200, 0x0820, X 0x0410, 0x00c0, 0x600c, 0x0200, X 0x0c20, 0x0c30, 0x0080, 0x2008, X 0x0300, 0x0c20, 0x0820, 0x0180, X 0x2008, 0x0100, 0x0420, 0x0820, X 0x0100, 0x2008, 0x0180, 0x0430, X 0x1860, 0x0100, 0x2008, 0x0080, X 0x0610, 0x1040, 0x0300, 0x1110, X 0x0080, 0x0218, 0x30c0, 0x0200, X 0x1390, 0x00c0, 0x0308, 0x2080, X 0x0600, 0x1110, 0x0040, 0x0104, X 0x6180, 0x0400, 0x1010, 0x0060, X 0x0184, 0x4100, 0x0400, 0x1010, X 0x0020, 0x00c6, 0x8300, 0x0c00, X 0x1010, 0x0020, 0x0041, 0x8200, X 0x0001, 0x1010, 0x8000, 0x0061, X 0x0600, 0x0001, 0x1010, 0x8000, X 0x0030, 0x0c00, 0x0001, 0x1010, X 0xc000, 0x0010, 0x1800, 0xff02, X 0xf01f, 0x60ff, 0x0018, 0x3000, X 0x01fe, 0x0000, 0x3f80, 0x000c, X 0x2000, 0x4000, 0x2108, 0x0004, X 0x0006, 0xc000, 0xe200, 0x739c, X 0x008e, 0x0003, 0x8000, 0x4711, X 0x2108, 0x11c4, 0x0001, 0x0000, X 0x023b, 0x0000, 0xb880, 0x0000, X 0x0000, 0x0012, 0xffff, 0x9003, X 0x0000, 0x0000, 0xfc02, 0x0001, X 0xc0fe, 0x0000, 0x0000, 0x07fa, X 0x0380, 0x5f80, 0x0000, 0x0000, X 0x0002, 0x0fe0, 0x4000, 0x0000, X 0x0000, 0x003a, 0x3ff8, 0x5c00, X 0x0000, 0x0000, 0x00fa, 0x0fe0, X 0x5f00, 0x0000, 0x0000, 0x03fa, X 0x0380, 0x5fc0, 0x0000, 0x0000, X 0x00fa, 0x0000, 0x5f00, 0x0000, X 0x0000, 0x003a, 0xffff, 0x5c03, X 0x0000, 0x0000, 0xfc02, 0x0001, X 0x40fe, 0x0000, 0x0000, 0x07fa, X 0x0000, 0x5f80, 0x0000, 0x0000, X 0x0002, 0x0000, 0x4000, 0x0000, X 0x0000, 0xfffe, 0xffff, 0x7fff, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000}; END_OF_king_outline.bitmap if test 4479 -ne `wc -c <king_outline.bitmap`; then echo shar: \"king_outline.bitmap\" unpacked with wrong size! fi # end of overwriting check fi if test -f knight_mask.bitmap -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"knight_mask.bitmap\" else echo shar: Extracting \"knight_mask.bitmap\" \(4476 characters\) sed "s/^X//" >knight_mask.bitmap <<'END_OF_knight_mask.bitmap' X/* This file contains code for X-CHESS. X Copyright (C) 1986 Free Software Foundation, Inc. X XThis file is part of X-CHESS. X XX-CHESS is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY. No author or distributor Xaccepts responsibility to anyone for the consequences of using it Xor for whether it serves any particular purpose or works at all, Xunless he says so in writing. Refer to the X-CHESS General Public XLicense for full details. X XEveryone is granted permission to copy, modify and redistribute XX-CHESS, but only under the conditions described in the XX-CHESS General Public License. A copy of this license is Xsupposed to have been given to you along with X-CHESS so you Xcan know your rights and responsibilities. It should be in a Xfile named COPYING. Among other things, the copyright notice Xand this notice must be preserved on all copies. */ X X#define knight_mask_width 80 X#define knight_mask_height 80 Xstatic short knight_mask_bits[] = { X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0007, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0007, 0x0000, 0x0000, 0x0000, X 0x0000, 0x000f, 0x0000, 0x0000, X 0x0000, 0x9c00, 0x000f, 0x0000, X 0x0000, 0x0000, 0xbe00, 0x000f, X 0x0000, 0x0000, 0x0000, 0xfe00, X 0x001f, 0x0000, 0x0000, 0x0000, X 0xfc00, 0x001f, 0x0000, 0x0000, X 0x0000, 0xfc00, 0x007f, 0x0000, X 0x0000, 0x0000, 0xf800, 0x01ff, X 0x0000, 0x0000, 0x0000, 0xf800, X 0x7fff, 0x0000, 0x0000, 0x0000, X 0xf800, 0xffff, 0x0001, 0x0000, X 0x0000, 0xf000, 0xffff, 0x0003, X 0x0000, 0x0000, 0xf000, 0xffff, X 0x001f, 0x0000, 0x0000, 0xfc00, X 0xffff, 0x003f, 0x0000, 0x0000, X 0xff80, 0xffff, 0x00ff, 0x0000, X 0x0000, 0xffc0, 0xffff, 0x03ff, X 0x0000, 0x0000, 0xfff0, 0xffff, X 0x03ff, 0x0000, 0x0000, 0xfff8, X 0xffff, 0x0fff, 0x0000, 0x0000, X 0xfffc, 0xffff, 0x1fff, 0x0000, X 0x0000, 0xfffe, 0xffff, 0x3fff, X 0x0000, 0x8000, 0xffff, 0xffff, X 0xffff, 0x0000, 0xc000, 0xffff, X 0xffff, 0xffff, 0x0000, 0xe000, X 0xffff, 0xffff, 0xffff, 0x0001, X 0xf000, 0xffff, 0xffff, 0xffff, X 0x0003, 0xf800, 0xffff, 0xffff, X 0xffff, 0x0007, 0xfc00, 0xffff, X 0xffff, 0xffff, 0x0007, 0xfe00, X 0xffff, 0xffff, 0xffff, 0x000f, X 0xfe00, 0xffff, 0xffff, 0xffff, X 0x000f, 0xff00, 0xffff, 0xffff, X 0xffff, 0x001f, 0xff80, 0xffff, X 0xffff, 0xffff, 0x001f, 0xff80, X 0xffff, 0xffff, 0xffff, 0x003f, X 0xffc0, 0xffff, 0xffff, 0xffff, X 0x003f, 0xffe0, 0xffff, 0xffff, X 0xffff, 0x007f, 0xffe0, 0xffff, X 0xffff, 0xffff, 0x007f, 0xfff0, X 0xffff, 0xffff, 0xffff, 0x00ff, X 0xfff0, 0xffff, 0xffff, 0xffff, X 0x01ff, 0xfff8, 0xffff, 0xffff, X 0xffff, 0x01ff, 0xfff8, 0xffff, X 0xffc7, 0xffff, 0x01ff, 0xfffc, X 0xffff, 0xffc1, 0xffff, 0x03ff, X 0xfffc, 0x01ff, 0xffc0, 0xffff, X 0x0fff, 0xfffc, 0x00ff, 0xffe0, X 0xffff, 0x0fff, 0xfffc, 0x007f, X 0xfff0, 0xffff, 0x0fff, 0xdffc, X 0x003f, 0xfff8, 0xffff, 0x0fff, X 0xeffc, 0x001f, 0xfff8, 0xffff, X 0x1fff, 0xf7f8, 0x000f, 0xfffc, X 0xffff, 0x1fff, 0xfbf8, 0x0007, X 0xfffc, 0xffff, 0x1fff, 0xf9f0, X 0x0003, 0xfffe, 0xffff, 0x1fff, X 0xf800, 0x0001, 0xfffe, 0xffff, X 0x1fff, 0xf800, 0x0000, 0xffff, X 0xffff, 0x1fff, 0x0000, 0x8000, X 0xffff, 0xffff, 0x1fff, 0x0000, X 0xc000, 0xffff, 0xffff, 0x1fff, X 0x0000, 0xe000, 0xffff, 0xffff, X 0x1fff, 0x0000, 0xe000, 0xffff, X 0xffff, 0x1fff, 0x0000, 0xf800, X 0xffff, 0xffff, 0x7fff, 0x0000, X 0xf800, 0xffff, 0xffff, 0x7fff, X 0x0000, 0xfc00, 0xffff, 0xffff, X 0x7fff, 0x0000, 0xfe00, 0xffff, X 0xffff, 0x7fff, 0x0000, 0xff00, X 0xffff, 0xffff, 0x7fff, 0x0000, X 0xff00, 0xffff, 0xffff, 0x7fff, X 0x0000, 0xff80, 0xffff, 0xffff, X 0x7fff, 0x0000, 0xff80, 0xffff, X 0xffff, 0x7fff, 0x0000, 0xffc0, X 0xffff, 0xffff, 0x7fff, 0x0000, X 0xffc0, 0xffff, 0xffff, 0x7fff, X 0x0000, 0xffc0, 0xffff, 0xffff, X 0x7fff, 0x0000, 0xffe0, 0xffff, X 0xffff, 0x7fff, 0x0000, 0xfff0, X 0xffff, 0xffff, 0x7fff, 0x0000, X 0xfff0, 0xffff, 0xffff, 0x7fff, X 0x0000, 0xfff8, 0xffff, 0xffff, X 0x7fff, 0x0000, 0xfff8, 0xffff, X 0xffff, 0x7fff, 0x0000, 0xfffc, X 0xffff, 0xffff, 0x7fff, 0x0000, X 0xfffe, 0xffff, 0xffff, 0x7fff, X 0x0000, 0xfffe, 0xffff, 0xffff, X 0x7fff, 0x0000, 0xffff, 0xffff, X 0xffff, 0x7fff, 0x0000, 0xffff, X 0xffff, 0xffff, 0x7fff, 0x0000, X 0xffff, 0xffff, 0xffff, 0x7fff, X 0x0000, 0xffff, 0xffff, 0xffff, X 0x7fff, 0x0000, 0xffff, 0xffff, X 0xffff, 0x7fff, 0x0000, 0xffff, X 0xffff, 0xffff, 0x7fff, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000}; END_OF_knight_mask.bitmap if test 4476 -ne `wc -c <knight_mask.bitmap`; then echo shar: \"knight_mask.bitmap\" unpacked with wrong size! fi # end of overwriting check fi if test -f knight_outline.bitmap -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"knight_outline.bitmap\" else echo shar: Extracting \"knight_outline.bitmap\" \(4485 characters\) sed "s/^X//" >knight_outline.bitmap <<'END_OF_knight_outline.bitmap' X/* This file contains code for X-CHESS. X Copyright (C) 1986 Free Software Foundation, Inc. X XThis file is part of X-CHESS. X XX-CHESS is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY. No author or distributor Xaccepts responsibility to anyone for the consequences of using it Xor for whether it serves any particular purpose or works at all, Xunless he says so in writing. Refer to the X-CHESS General Public XLicense for full details. X XEveryone is granted permission to copy, modify and redistribute XX-CHESS, but only under the conditions described in the XX-CHESS General Public License. A copy of this license is Xsupposed to have been given to you along with X-CHESS so you Xcan know your rights and responsibilities. It should be in a Xfile named COPYING. Among other things, the copyright notice Xand this notice must be preserved on all copies. */ X X#define knight_outline_width 80 X#define knight_outline_height 80 Xstatic short knight_outline_bits[] = { X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0002, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0002, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0007, 0x0000, X 0x0000, 0x0000, 0x0c00, 0x0005, X 0x0000, 0x0000, 0x0000, 0x1800, X 0x000d, 0x0000, 0x0000, 0x0000, X 0x3800, 0x0009, 0x0000, 0x0000, X 0x0000, 0x3000, 0x0009, 0x0000, X 0x0000, 0x0000, 0xf000, 0x01f9, X 0x0000, 0x0000, 0x0000, 0x3000, X 0x0f00, 0x0000, 0x0000, 0x0000, X 0x2000, 0xf800, 0x0001, 0x0000, X 0x0000, 0x2000, 0x3000, 0x0000, X 0x0000, 0x0000, 0x2000, 0xe000, X 0x0003, 0x0000, 0x0000, 0x2000, X 0xc000, 0x0000, 0x0000, 0x0000, X 0x3800, 0x8000, 0x003f, 0x0000, X 0x0000, 0x0f00, 0x0000, 0x0008, X 0x0000, 0x0000, 0x0180, 0x0000, X 0x01f8, 0x0000, 0x0000, 0xf0e0, X 0x0001, 0x0040, 0x0000, 0x0000, X 0x5830, 0x0007, 0x0fc0, 0x0000, X 0x0000, 0x4c18, 0x0004, 0x0100, X 0x0000, 0x0000, 0x780e, 0x0007, X 0x1f00, 0x0000, 0x0000, 0xe023, X 0x0001, 0x0400, 0x0000, 0x8000, X 0x0011, 0x0000, 0x7c00, 0x0000, X 0xc000, 0x0008, 0x4000, 0x1000, X 0x0000, 0x6000, 0x0004, 0x4000, X 0xf000, 0x0003, 0x3000, 0x0002, X 0x6000, 0x2000, 0x0000, 0x1800, X 0x0001, 0x2000, 0xe000, 0x0007, X 0x8c00, 0x0000, 0x2000, 0x8000, X 0x0000, 0x4400, 0x0000, 0x2000, X 0x8000, 0x0007, 0x2600, 0x0000, X 0x1000, 0x0000, 0x0001, 0x1300, X 0x0000, 0x1000, 0x0010, 0x001f, X 0x0900, 0x0040, 0x1800, 0x0008, X 0x0002, 0x0580, 0x00c0, 0x0c00, X 0x000c, 0x003e, 0x0080, 0x0080, X 0x03c0, 0x0006, 0x0004, 0x00c0, X 0x0180, 0x0170, 0x00c3, 0x007c, X 0x0060, 0x0300, 0x811e, 0x0041, X 0x0004, 0x0020, 0xce00, 0x6183, X 0x0060, 0x00fc, 0x0030, 0x7f80, X 0x1c80, 0x0030, 0x0008, 0xe010, X 0x00c1, 0x0780, 0x0010, 0x01f8, X 0x3018, 0x0061, 0x0080, 0x0008, X 0x0010, 0x9808, 0x0031, 0x00c0, X 0x000c, 0x07f0, 0x8c08, 0x0018, X 0x0040, 0x0003, 0x0020, 0x8618, X 0x000c, 0xc060, 0x0001, 0x07e0, X 0xc310, 0x0006, 0x3030, 0x0000, X 0x0020, 0x61f0, 0x0002, 0x1e10, X 0x0000, 0x0fe0, 0x3060, 0x0002, X 0x0398, 0x0000, 0x0040, 0x1000, X 0x0002, 0x000c, 0x0000, 0x0fc0, X 0xb000, 0x0003, 0x0006, 0x0000, X 0x0040, 0xc000, 0x0000, 0x0002, X 0x0000, 0x0fc0, 0x0000, 0x0000, X 0x0003, 0x0000, 0x0080, 0x0000, X 0x8000, 0x0001, 0x0000, 0x0f80, X 0x0000, 0x8000, 0x0000, 0x0000, X 0x0080, 0x0000, 0xc000, 0x0000, X 0x0000, 0x1f80, 0x0000, 0x4000, X 0x0000, 0x0000, 0x0100, 0x0000, X 0x6000, 0x0000, 0x0000, 0x3f00, X 0x0000, 0x3000, 0x0000, 0x0000, X 0x0100, 0x0000, 0x1800, 0x0000, X 0x0000, 0x3f00, 0x0000, 0x0c00, X 0x0000, 0x0000, 0x0100, 0x0000, X 0x0400, 0x0000, 0x0000, 0x3f00, X 0x0000, 0x0600, 0x0000, 0x0000, X 0x0100, 0x0000, 0x0300, 0x0000, X 0x0000, 0x3f00, 0x0000, 0x0100, X 0x0000, 0x0000, 0x0100, 0x0000, X 0x0100, 0x0000, 0x0000, 0x3f00, X 0x0000, 0x0180, 0x0000, 0x0000, X 0x0100, 0x0000, 0x0080, 0x0000, X 0x0000, 0x3f00, 0x0000, 0x00c0, X 0x0000, 0x0000, 0x0100, 0x0000, X 0x0060, 0x0000, 0x0000, 0x3f00, X 0x0000, 0x0020, 0x0000, 0x0000, X 0x0100, 0x0000, 0x0030, 0x0000, X 0x0000, 0x3f00, 0x0000, 0x0010, X 0x0000, 0x0000, 0x0100, 0x0000, X 0x0018, 0x0000, 0x0000, 0x3f00, X 0x0000, 0x0008, 0x0000, 0x0000, X 0x0100, 0x0000, 0x000c, 0x0000, X 0x0000, 0x3f00, 0x0000, 0x0004, X 0x0000, 0x0000, 0x0100, 0x0000, X 0x0006, 0x0000, 0x0000, 0x3f00, X 0x0000, 0x0002, 0x0000, 0x0000, X 0x0100, 0x0000, 0xfffe, 0xffff, X 0xffff, 0x3fff, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000}; END_OF_knight_outline.bitmap if test 4485 -ne `wc -c <knight_outline.bitmap`; then echo shar: \"knight_outline.bitmap\" unpacked with wrong size! fi # end of overwriting check fi if test -f pawn_outline.bitmap -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"pawn_outline.bitmap\" else echo shar: Extracting \"pawn_outline.bitmap\" \(4479 characters\) sed "s/^X//" >pawn_outline.bitmap <<'END_OF_pawn_outline.bitmap' X/* This file contains code for X-CHESS. X Copyright (C) 1986 Free Software Foundation, Inc. X XThis file is part of X-CHESS. X XX-CHESS is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY. No author or distributor Xaccepts responsibility to anyone for the consequences of using it Xor for whether it serves any particular purpose or works at all, Xunless he says so in writing. Refer to the X-CHESS General Public XLicense for full details. X XEveryone is granted permission to copy, modify and redistribute XX-CHESS, but only under the conditions described in the XX-CHESS General Public License. A copy of this license is Xsupposed to have been given to you along with X-CHESS so you Xcan know your rights and responsibilities. It should be in a Xfile named COPYING. Among other things, the copyright notice Xand this notice must be preserved on all copies. */ X X#define pawn_outline_width 80 X#define pawn_outline_height 80 Xstatic short pawn_outline_bits[] = { X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x1f80, 0x0000, 0x0000, 0x0000, X 0x0000, 0x70e0, 0x0000, 0x0000, X 0x0000, 0x0000, 0xc030, 0x0000, X 0x0000, 0x0000, 0x0000, 0x8010, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x8018, 0x0001, 0x0000, 0x0000, X 0x0000, 0x0008, 0x0001, 0x0000, X 0x0000, 0x0000, 0x0008, 0x0001, X 0x0000, 0x0000, 0x0000, 0x0008, X 0x0001, 0x0000, 0x0000, 0x0000, X 0x8018, 0x0001, 0x0000, 0x0000, X 0x0000, 0x8010, 0x0000, 0x0000, X 0x0000, 0x0000, 0xc030, 0x0000, X 0x0000, 0x0000, 0x0000, 0x70e0, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x3fc0, 0x0000, 0x0000, 0x0000, X 0x0000, 0xfff8, 0x0001, 0x0000, X 0x0000, 0x0000, 0x000c, 0x0003, X 0x0000, 0x0000, 0x0000, 0x0006, X 0x000e, 0x0000, 0x0000, 0x8000, X 0x0003, 0x0038, 0x0000, 0x0000, X 0xe000, 0x0000, 0x00e0, 0x0000, X 0x0000, 0xf800, 0xffff, 0x03ff, X 0x0000, 0x0000, 0x0000, 0x0010, X 0x0001, 0x0000, 0x0000, 0x0000, X 0x0010, 0x0001, 0x0000, 0x0000, X 0x0000, 0x0010, 0x0001, 0x0000, X 0x0000, 0x0000, 0x0018, 0x0003, X 0x0000, 0x0000, 0x0000, 0x0008, X 0x0002, 0x0000, 0x0000, 0x0000, X 0x0008, 0x0002, 0x0000, 0x0000, X 0x0000, 0x000c, 0x0006, 0x0000, X 0x0000, 0x0000, 0x0004, 0x0004, X 0x0000, 0x0000, 0x0000, 0x0004, X 0x0004, 0x0000, 0x0000, 0x0000, X 0x0006, 0x000c, 0x0000, 0x0000, X 0x0000, 0x0002, 0x0008, 0x0000, X 0x0000, 0x0000, 0x0003, 0x0018, X 0x0000, 0x0000, 0x8000, 0x0001, X 0x0030, 0x0000, 0x0000, 0x8000, X 0x0000, 0x0020, 0x0000, 0x0000, X 0xc000, 0x0000, 0x0060, 0x0000, X 0x0000, 0x6000, 0x0000, 0x00c0, X 0x0000, 0x0000, 0x2000, 0x0000, X 0x0080, 0x0000, 0x0000, 0x2000, X 0x0000, 0x0080, 0x0000, 0x0000, X 0x3000, 0x0000, 0x0180, 0x0000, X 0x0000, 0x1000, 0x0000, 0x0100, X 0x0000, 0x0000, 0x1800, 0x0000, X 0x0300, 0x0000, 0x0000, 0x0800, X 0x0000, 0x0200, 0x0000, 0x0000, X 0x0800, 0x0000, 0x0200, 0x0000, X 0x0000, 0x0800, 0x0000, 0x0200, X 0x0000, 0x0000, 0x0800, 0x0000, X 0x0200, 0x0000, 0x0000, 0x0800, X 0x0000, 0x0200, 0x0000, 0x0000, X 0x0800, 0x0000, 0x0200, 0x0000, X 0x0000, 0x1800, 0x0000, 0x0300, X 0x0000, 0x0000, 0x1000, 0x0000, X 0x0100, 0x0000, 0x0000, 0x1000, X 0x0000, 0x0100, 0x0000, 0x0000, X 0x3000, 0x0000, 0x0180, 0x0000, X 0x0000, 0x2000, 0x0000, 0x0080, X 0x0000, 0x0000, 0x2000, 0x0000, X 0x0080, 0x0000, 0x0000, 0x6000, X 0x0000, 0x00c0, 0x0000, 0x0000, X 0x4000, 0x0000, 0x0040, 0x0000, X 0x0000, 0xc000, 0x0000, 0x0060, X 0x0000, 0x0000, 0x8000, 0x0000, X 0x0020, 0x0000, 0x0000, 0x8000, X 0x0001, 0x0030, 0x0000, 0x0000, X 0x0000, 0x0003, 0x0018, 0x0000, X 0x0000, 0x0000, 0x0002, 0x0008, X 0x0000, 0x0000, 0x0000, 0x0006, X 0x000c, 0x0000, 0x0000, 0x0000, X 0x0004, 0x0004, 0x0000, 0x0000, X 0x0000, 0x000c, 0x0006, 0x0000, X 0x0000, 0xe000, 0x001f, 0x00ff, X 0x0000, 0x0000, 0x7c00, 0xc078, X 0x0781, 0x0000, 0x0000, 0x0700, X 0x7fc0, 0x1c00, 0x0000, 0x0000, X 0x0180, 0x0000, 0x3000, 0x0000, X 0x0000, 0x00e0, 0x0000, 0xe000, X 0x0000, 0x0000, 0x0030, 0x0000, X 0x8000, 0x0001, 0x0000, 0x0018, X 0x0000, 0x0000, 0x0003, 0x0000, X 0x000c, 0x0000, 0x0000, 0x0006, X 0x0000, 0x0004, 0x0000, 0x0000, X 0x0004, 0x0000, 0x0006, 0x0000, X 0x0000, 0x000c, 0x0000, 0x0002, X 0x0000, 0x0000, 0x0008, 0x0000, X 0x0002, 0x0000, 0x0000, 0x0008, X 0x0000, 0x0003, 0x0000, 0x0000, X 0x0018, 0x0000, 0xffff, 0xffff, X 0xffff, 0x001f, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000}; END_OF_pawn_outline.bitmap if test 4479 -ne `wc -c <pawn_outline.bitmap`; then echo shar: \"pawn_outline.bitmap\" unpacked with wrong size! fi # end of overwriting check fi if test -f queen_outline.bitmap -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"queen_outline.bitmap\" else echo shar: Extracting \"queen_outline.bitmap\" \(4482 characters\) sed "s/^X//" >queen_outline.bitmap <<'END_OF_queen_outline.bitmap' X/* This file contains code for X-CHESS. X Copyright (C) 1986 Free Software Foundation, Inc. X XThis file is part of X-CHESS. X XX-CHESS is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY. No author or distributor Xaccepts responsibility to anyone for the consequences of using it Xor for whether it serves any particular purpose or works at all, Xunless he says so in writing. Refer to the X-CHESS General Public XLicense for full details. X XEveryone is granted permission to copy, modify and redistribute XX-CHESS, but only under the conditions described in the XX-CHESS General Public License. A copy of this license is Xsupposed to have been given to you along with X-CHESS so you Xcan know your rights and responsibilities. It should be in a Xfile named COPYING. Among other things, the copyright notice Xand this notice must be preserved on all copies. */ X X#define queen_outline_width 80 X#define queen_outline_height 80 Xstatic short queen_outline_bits[] = { X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x01c0, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0360, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0220, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0360, 0x0000, 0x0000, 0x0000, X 0x0000, 0x01c0, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0180, 0x0000, X 0x0000, 0x0000, 0x00e0, 0x0180, X 0x0000, 0x0000, 0x0000, 0x01b0, X 0x0180, 0x0700, 0x0000, 0x0000, X 0x0110, 0x0180, 0x0d80, 0x0000, X 0x0000, 0x01b0, 0x03c0, 0x0880, X 0x0000, 0x0000, 0x00e0, 0x0240, X 0x0d80, 0x0000, 0x0000, 0x0040, X 0x0240, 0x0700, 0x0000, 0x0000, X 0x00c0, 0x0240, 0x0300, 0x0000, X 0x0000, 0x00c0, 0x0240, 0x0300, X 0x0000, 0x0000, 0x00c0, 0x0240, X 0x0300, 0x0000, 0x0000, 0x01c0, X 0x0240, 0x0380, 0x0000, 0x0000, X 0x0140, 0x0240, 0x0280, 0x0000, X 0x0000, 0x0140, 0x0660, 0x0280, X 0x0000, 0x0000, 0x0340, 0x0420, X 0x02c0, 0x0000, 0x001c, 0x0240, X 0x0420, 0x0240, 0x0000, 0x0036, X 0x0240, 0x0420, 0x0240, 0x0e00, X 0x0022, 0x0640, 0x0420, 0x0260, X 0x1b00, 0x0036, 0x0440, 0x0420, X 0x0220, 0x1100, 0x003c, 0x0440, X 0x0420, 0x0220, 0x1b00, 0x0070, X 0x0c40, 0x0420, 0x0230, 0x0e00, X 0x0060, 0x0840, 0x0420, 0x0210, X 0x0300, 0x00e0, 0x0840, 0x0c30, X 0x0210, 0x0380, 0x01c0, 0x1840, X 0x0810, 0x0218, 0x0180, 0x0140, X 0x1040, 0x0810, 0x0208, 0x01c0, X 0x0340, 0x1040, 0x0810, 0x0208, X 0x0160, 0x0640, 0x1040, 0x0810, X 0x0208, 0x0120, 0x0440, 0x3040, X 0x0810, 0x020c, 0x0130, 0x0cc0, X 0x2040, 0x0810, 0x0204, 0x0118, X 0x1880, 0x2040, 0x0810, 0x0204, X 0x0108, 0x1080, 0x6040, 0x0810, X 0x0206, 0x018c, 0x3080, 0x4040, X 0x1818, 0x0202, 0x0084, 0x2080, X 0x4040, 0x1008, 0x0202, 0x0086, X 0x6080, 0xc040, 0x1008, 0x0203, X 0x0083, 0xc180, 0x8040, 0x1008, X 0x0201, 0x0081, 0x8100, 0x8040, X 0x1008, 0x8201, 0x0081, 0x8100, X 0x8041, 0x9009, 0x8201, 0x0080, X 0x0100, 0x0043, 0x9009, 0xc200, X 0x00c0, 0x0100, 0x0042, 0x9009, X 0x6200, 0x0040, 0x0100, 0x0046, X 0xf00f, 0x2200, 0x0040, 0x0300, X 0x004c, 0x0000, 0x3200, 0x0040, X 0x0200, 0x0048, 0x0000, 0x1a00, X 0x0040, 0x0200, 0x0058, 0x0000, X 0x0a00, 0x0040, 0x0200, 0x0070, X 0x0000, 0x0e00, 0x0040, 0x0200, X 0x0000, 0x0000, 0x0000, 0x0040, X 0x0600, 0x0000, 0x0000, 0x0000, X 0x0060, 0x0400, 0x0000, 0x0000, X 0x0000, 0x0020, 0x0400, 0x0000, X 0x0000, 0x0000, 0x0020, 0x0400, X 0x0000, 0x0000, 0x0000, 0x0020, X 0x0400, 0x0000, 0x0000, 0x0000, X 0x0020, 0x0c00, 0x0000, 0x7ffe, X 0x0000, 0x0030, 0x1800, 0xfc00, X 0xc003, 0x003f, 0x0010, 0x1000, X 0x07fe, 0x0180, 0x7fe0, 0x0018, X 0x3000, 0x0003, 0x07e0, 0xc000, X 0x000c, 0x6000, 0x0018, 0x1ff8, X 0x1800, 0x0006, 0x4000, 0x007e, X 0x07e0, 0x7e00, 0x0002, 0x4000, X 0x01ff, 0x0180, 0xff80, 0x0002, X 0x4000, 0x007e, 0x0000, 0x7e00, X 0x0002, 0xc000, 0x0018, 0x7ffe, X 0x1800, 0x0003, 0x8000, 0xfc00, X 0xc003, 0x003f, 0x0001, 0x8000, X 0x07fe, 0x0000, 0x7fe0, 0x0001, X 0x8000, 0x0000, 0x0000, 0x0000, X 0x0001, 0x8000, 0x0000, 0x0000, X 0x0000, 0x0001, 0xc000, 0x0000, X 0x0000, 0x0000, 0x0003, 0x4000, X 0x0000, 0x0000, 0x0000, 0x0002, X 0x4000, 0x0000, 0x0000, 0x0000, X 0x0002, 0x6000, 0x0000, 0x0000, X 0x0000, 0x0006, 0xe000, 0xffff, X 0xffff, 0xffff, 0x0007, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000}; END_OF_queen_outline.bitmap if test 4482 -ne `wc -c <queen_outline.bitmap`; then echo shar: \"queen_outline.bitmap\" unpacked with wrong size! fi # end of overwriting check fi if test -f rook_outline.bitmap -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"rook_outline.bitmap\" else echo shar: Extracting \"rook_outline.bitmap\" \(4479 characters\) sed "s/^X//" >rook_outline.bitmap <<'END_OF_rook_outline.bitmap' X/* This file contains code for X-CHESS. X Copyright (C) 1986 Free Software Foundation, Inc. X XThis file is part of X-CHESS. X XX-CHESS is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY. No author or distributor Xaccepts responsibility to anyone for the consequences of using it Xor for whether it serves any particular purpose or works at all, Xunless he says so in writing. Refer to the X-CHESS General Public XLicense for full details. X XEveryone is granted permission to copy, modify and redistribute XX-CHESS, but only under the conditions described in the XX-CHESS General Public License. A copy of this license is Xsupposed to have been given to you along with X-CHESS so you Xcan know your rights and responsibilities. It should be in a Xfile named COPYING. Among other things, the copyright notice Xand this notice must be preserved on all copies. */ X X#define rook_outline_width 80 X#define rook_outline_height 80 Xstatic short rook_outline_bits[] = { X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0xfff8, 0x0000, 0x0000, 0x0000, X 0x0000, 0x8008, 0x0000, 0x0000, X 0x0000, 0x01e0, 0x8008, 0x3c00, X 0x0000, 0x8000, 0x013f, 0x8008, X 0xe400, 0x000f, 0xc000, 0x0100, X 0x8008, 0x0400, 0x0018, 0x4000, X 0x0100, 0x8008, 0x0400, 0x0010, X 0x4000, 0x0100, 0x8008, 0x0400, X 0x0010, 0x4000, 0x0100, 0x800f, X 0x0407, 0x0010, 0x4000, 0xfd00, X 0x0001, 0x05fc, 0x0010, 0x4000, X 0x0700, 0x0000, 0x0700, 0x0010, X 0x4000, 0x0000, 0xfffc, 0x0001, X 0x0010, 0x4000, 0xf000, 0x0007, X 0x007f, 0x0010, 0x4000, 0x1fc0, X 0x0000, 0x1fc0, 0x0010, 0xc000, X 0x007f, 0x0002, 0xf002, 0x001f, X 0x0000, 0x0040, 0x0002, 0x1002, X 0x0000, 0x0000, 0x0040, 0x0002, X 0x1002, 0x0000, 0x0000, 0x0040, X 0x0002, 0x1002, 0x0000, 0x0000, X 0x0040, 0x0002, 0x1002, 0x0000, X 0x0000, 0x0040, 0x0002, 0x1002, X 0x0000, 0x0000, 0x0040, 0x0002, X 0x1002, 0x0000, 0x0000, 0x0040, X 0x0002, 0x1002, 0x0000, 0x0000, X 0x0040, 0x0002, 0x1002, 0x0000, X 0x0000, 0x0040, 0x0002, 0x1002, X 0x0000, 0x0000, 0x8040, 0xffff, X 0x100f, 0x0000, 0x0000, 0xffc0, X 0x0100, 0x1ff8, 0x0000, 0x0000, X 0x0040, 0x0100, 0x1000, 0x0000, X 0x0000, 0x0040, 0x0100, 0x1000, X 0x0000, 0x0000, 0x0040, 0x0100, X 0x1000, 0x0000, 0x0000, 0x0040, X 0x0100, 0x1000, 0x0000, 0x0000, X 0x0040, 0x0100, 0x1000, 0x0000, X 0x0000, 0x0040, 0x0100, 0x1000, X 0x0000, 0x0000, 0x0040, 0x0100, X 0x1000, 0x0000, 0x0000, 0x0040, X 0x0100, 0x1000, 0x0000, 0x0000, X 0x0040, 0x0100, 0x1000, 0x0000, X 0x0000, 0x0040, 0x0100, 0x1000, X 0x0000, 0x0000, 0x0040, 0x0100, X 0x1000, 0x0000, 0x0000, 0x0040, X 0x7ff0, 0x1000, 0x0000, 0x0000, X 0xffc0, 0xc01f, 0x1fff, 0x0000, X 0x0000, 0x0040, 0x0002, 0x1002, X 0x0000, 0x0000, 0x0040, 0x0002, X 0x1002, 0x0000, 0x0000, 0x0040, X 0x0002, 0x1002, 0x0000, 0x0000, X 0x0040, 0x0002, 0x1002, 0x0000, X 0x0000, 0x0040, 0x0002, 0x1002, X 0x0000, 0x0000, 0x0040, 0x0002, X 0x1002, 0x0000, 0x0000, 0x0040, X 0x0002, 0x1002, 0x0000, 0x0000, X 0x0040, 0x0002, 0x1002, 0x0000, X 0x0000, 0x0040, 0x0002, 0x1002, X 0x0000, 0x0000, 0x0040, 0x0002, X 0x1002, 0x0000, 0x0000, 0x0040, X 0x0002, 0x1002, 0x0000, 0x0000, X 0xffc0, 0xffff, 0x1fff, 0x0000, X 0x0000, 0x0040, 0x0200, 0x1000, X 0x0000, 0x0000, 0x0040, 0x0200, X 0x1000, 0x0000, 0x0000, 0x0040, X 0x0200, 0x1000, 0x0000, 0x0000, X 0x0040, 0x0200, 0x1000, 0x0000, X 0x0000, 0x0040, 0x0200, 0x1000, X 0x0000, 0x0000, 0x0040, 0x0200, X 0x1000, 0x0000, 0x0000, 0x0040, X 0x0200, 0x1000, 0x0000, 0x0000, X 0x0040, 0x0200, 0x1000, 0x0000, X 0x0000, 0x0040, 0x0200, 0x1000, X 0x0000, 0x0000, 0x0040, 0x0200, X 0x1000, 0x0000, 0x0000, 0x0040, X 0x0200, 0x1000, 0x0000, 0x0000, X 0x0040, 0x0200, 0x1000, 0x0000, X 0x0000, 0xffc0, 0xffff, 0x1fff, X 0x0000, 0x0000, 0x0078, 0x0000, X 0xf000, 0x0000, 0x0000, 0x000c, X 0x0000, 0x8000, 0x0001, 0x0000, X 0x0006, 0x0000, 0x0000, 0x0003, X 0x0000, 0x0002, 0x0000, 0x0000, X 0x0002, 0x0000, 0x0002, 0x0000, X 0x0000, 0x0002, 0x0000, 0xffff, X 0xffff, 0xffff, 0x0007, 0x8000, X 0x0001, 0x0000, 0x0000, 0x000c, X 0xc000, 0x0000, 0x0000, 0x0000, X 0x0018, 0x6000, 0x0000, 0x0000, X 0x0000, 0x0030, 0x2000, 0x0000, X 0x0000, 0x0000, 0x0020, 0x2000, X 0x0000, 0x0000, 0x0000, 0x0020, X 0xe000, 0xffff, 0xffff, 0xffff, X 0x003f, 0xe000, 0xffff, 0xffff, X 0xffff, 0x003f, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000, X 0x0000, 0x0000, 0x0000, 0x0000}; END_OF_rook_outline.bitmap if test 4479 -ne `wc -c <rook_outline.bitmap`; then echo shar: \"rook_outline.bitmap\" unpacked with wrong size! fi # end of overwriting check fi if test -f xchess.1 -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"xchess.1\" else echo shar: Extracting \"xchess.1\" \(6181 characters\) sed "s/^X//" >xchess.1 <<'END_OF_xchess.1' X.TH XCHESS 1 "14 Nov 1986" "X Version 10" X.SH NAME Xxchess \- X chess display X.SH SYNOPSIS X.B xchess X[ option ... ] [ white-display ] [ black-display ] X.SH DESCRIPTION X.PP X.B xchess Xis a chess display program which allows players to play a game on either Xone or two displays, or play a chess-playing program. It uses the X.B X Xwindow system. If one or no display names are given, it will open up one Xwindow and both black and white at the same board. If two displays are Xgiven, X.B xchess Xwill accept moves from each player in his turn. Black's board will be drawn Xwith his pieces at the bottom. X.PP X.B xchess Xwill not allow a player to make an illegal move. It accepts all legal moves, Xincluding castling and pawn capture \fIen passant\fR. X.SH OPTIONS X.TP 8 X.B -d XTurn on debugging. X.TP 8 X.B -f record-file XUse \fBrecord-file\fR for saving the game when the \fBSave\fR button is Xselected, or if the \fB-s\fR flag is given. The default is "xchess.game". X.TP 8 X.B -r saved-game XStart with the position at the end of the saved game in the named file. XThis file may be the result of the \fBSave\fR command, and may be in Xeither English or International format. When reading moves, one move Xit made per second. X.TP 8 X.B -q XDon't pause for a second every time a move is made when a game is being Xrestored. X.TP 8 X.B -v XWhenever a piece is moved, outline the path with a "lightning bolt". XThis option and the \fB-n\fR option are useful if you don't want to miss Xan opponent's move when he makes it. X.TP 8 X.B -i XUse International format for recording moves (squares numbered 1-8, a-h) Xas opposed to English (e.g, \fIp/k4xp/q5\fR). X.TP 8 X.B -t moves/timeunit XAllows \fBtimeunit\fR seconds for every \fBmoves\fR moves. If either player Xexceeds this allowance both recieve a message saying informing them of Xthis fact. X.TP 8 X.B -c XPlay the computer. X.B xchess Xwill start up a chess-playing program (currently the only one it knows Xhow to talk to is \fBGNU Chess\fR). X.TP 8 X.B -p program XThe name of the program to use if the \fB-c\fR option is given. The Xdefault is "/usr/public/gnuchess". Note that \fBgnuchess\fR must be Xcompiled with the \fIcompat\fR flag (in the file "main.c") set to 1. X.TP 8 X.B -b XIf the \fB-c\fR flag was given, have the computer play white. X.TP 8 X.B -bnw XIf the display has more than one display plane (i.e, is color), pretend Xit's black and white. X.TP 8 X.B -s XSave the moves in the record file as they are made. This is useful if Xyou don't want your game to be lost when \fBxchess\fR core dumps. X.TP 8 X.B -n XBe noisy \- beep after every move is made. X.TP 8 X.B -h host XRun GNU Chess on the specified \fBhost\fR. X.TP 8 X.B -R XRandomly chose who plays white and who plays black, if two displays are Xgiven. X.SH CONTROLS X.PP XThe window is divided up into several sub-windows. The pieces are moved by Xpushing down any mouse button on top of the piece, moving to the destination Xsquare, and releasing it. Castling is done by moving the king to the Xright square. If you push down on a piece and then let the button Xup without moving it, you must move that piece. ("Touch it, move it.") X.PP XThe progress of the game is listed in the "Game Record" window. Error Xmessages and such things are printed in the "Message" window. Both these Xwindows have scroll bars that you can use to move around. XThere are also windows for clocks and for a record of the pieces captured. X.PP XIf you type any keys in the window, the text will go into the message Xwindow of both players. This provides a simple communication facility. X.PP XThere are 9 buttons in the control window. They are as follows: X.TP 8 X.B Draw XBoth players must push this button to agree on a draw (just one is ok Xif only one display is being used). X.TP 8 X.B Resign XThe player whose turn it is to move resigns. X.TP 8 X.B Reset XStart over from the beginning. X.TP 8 X.B Back XRetract a move. If two displays are being used the other player will be Xasked to confirm this. X.TP 8 X.B Fwd XThis will re-play the most recently retracted move. This button in conjunction Xwith \fBBack\fR is useful for "scrolling around" in a saved game. X.TP 8 X.B Save XSave the game in the record file. X.TP 8 X.B Flip XRotate the board so that Black will have his pieces at the bottom. X.TP 8 X.B Switch XChange the mapping of boards to players. X.TP 8 X.B Pause XThis button has two functions. When a game is being restored, pieces will Xbe moved once a second. Hitting \fBPause\fR will stop this process, and Xhitting it again will restart it. During the time that it is stopped no Xother action can be made except restarting it. While a game is being played, X\fBPause\fR will stop the clock and restart it. X.SH DEFAULTS X.PP X\fBxchess\fR uses the following \fI.Xdefaults\fR: X.TP 8 X.B Noisy XThe -n flag. X.TP 8 X.B SaveMoves XThe -s flag. X.TP 8 X.B Algebraic XThe -i flag. X.TP 8 X.B BlackAndWhite XThe -bnw flag. X.TP 8 X.B QuickRestore XThe -q flag. X.TP 8 X.B Flash XThe -v flag. X.TP 8 X.B NumFlashes XHow many times to flash the move. The default is 5. X.TP 8 X.B FlashWidth XHow big to make the lightning bolt. The default is 10 pixels. X.TP 8 X.B ProgName XThe -p option. This may also be changed in the Makefile (-DDEF_PROG_NAME). X.TP 8 X.B ProgHost XThe -h option. X.TP 8 X.B RecordFile XThe -f option. X.TP 8 X.B BlackPiece XThe color of the black pieces. X.TP 8 X.B WhitePiece XThe color of the white pieces. X.TP 8 X.B BorderColor XThe color of the borders. X.TP 8 X.B BlackSquare XThe color of the black squares. X.TP 8 X.B WhiteSquare XThe color of the white squares. X.TP 8 X.B TextColor XThe color of routine messages and the move record text. X.TP 8 X.B ErrorText XThe color of error messages. X.TP 8 X.B PlayerText XThe color of player-entered text. X.TP 8 X.B TextBack XThe background color for the two text windows. X.TP 8 X.B CursorColor XThe color of the mouse and the text cursors. X.SH "SEE ALSO" XX(8), gnuchess(1), chess(5) X.SH AUTHOR XWayne A. Christopher (faustus@ic.berkeley.edu) X.SH BUGS X.PP XCheckmate and stalemate are not detected, so the appropriate player must resign Xor agree to a draw respectively. X.PP X\fBSwitch\fR doesn't work. X.PP XIf you are playing \fBgnuchess\fR, and you select Undo a few times so that it Xis \fBgnuchess\fR's turn to move, it won't do anything. END_OF_xchess.1 if test 6181 -ne `wc -c <xchess.1`; then echo shar: \"xchess.1\" unpacked with wrong size! fi # end of overwriting check fi if test -f xchess.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"xchess.c\" else echo shar: Extracting \"xchess.c\" \(6158 characters\) sed "s/^X//" >xchess.c <<'END_OF_xchess.c' X/* This file contains code for X-CHESS. X Copyright (C) 1986 Free Software Foundation, Inc. X XThis file is part of X-CHESS. X XX-CHESS is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY. No author or distributor Xaccepts responsibility to anyone for the consequences of using it Xor for whether it serves any particular purpose or works at all, Xunless he says so in writing. Refer to the X-CHESS General Public XLicense for full details. X XEveryone is granted permission to copy, modify and redistribute XX-CHESS, but only under the conditions described in the XX-CHESS General Public License. A copy of this license is Xsupposed to have been given to you along with X-CHESS so you Xcan know your rights and responsibilities. It should be in a Xfile named COPYING. Among other things, the copyright notice Xand this notice must be preserved on all copies. */ X X X/* RCS Info: $Revision: 1.5 $ on $Date: 86/11/26 12:11:32 $ X * $Source: /users/faustus/xchess/RCS/xchess.c,v $ X * Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group X * Permission is granted to do anything with this code except sell it X * or remove this message. X */ X X#define USAGE "xchess [ -d ] [ -f recordfile ] [ -r savedfile ] [ -i ]\n\ X\t[ -t moves/timeunit ] [ -c ] [ -p program ] [ -b ] [ -bnw ] [ -s ]\n\ X\t[ -n ] [ -h host ] [ -v ] [ -R ] [ whitedisplay ] [ blackdisplay ]" X X#include "xchess.h" X Xbool debug = false; Xbool oneboard = false; Xbool bnwflag = false; Xbool progflag = false; Xbool blackflag = false; Xbool quickflag = false; X Xchar *progname = DEF_PROGRAM; Xchar *proghost = NULL; Xchar *piecenames[] = { "pawn", "rook", "knight", "bishop", "queen", "king" } ; Xchar *colornames[] = { "white", "black", "none" } ; Xchar *movetypenames[] = { "move", "qcastle", "kcastle", "capture" } ; Xchar *dispname1 = NULL, *dispname2 = NULL; X Xchar *black_piece_color = BLACK_PIECE_COLOR; Xchar *white_piece_color = WHITE_PIECE_COLOR; Xchar *black_square_color = BLACK_SQUARE_COLOR; Xchar *white_square_color = WHITE_SQUARE_COLOR; Xchar *border_color = BORDER_COLOR; Xchar *text_color = TEXT_COLOR; Xchar *text_back = TEXT_BACK; Xchar *error_text = ERROR_TEXT; Xchar *player_text = PLAYER_TEXT; Xchar *cursor_color = CURSOR_COLOR; X Xint num_flashes = NUM_FLASHES; Xint flash_size = FLASH_SIZE; X Xvoid Xmain(ac, av) X char **av; X{ X char *program = av[0]; X char *recfile = NULL, *s; X bool randflag = false; X move *m; X X /* Process args. */ X av++; ac--; X while (**av == '-') { X if (eq(*av, "-d")) { X debug = true; X } else if (eq(*av, "-f")) { X av++; ac--; X if (*av) X record_file = *av; X else X goto usage; X } else if (eq(*av, "-r")) { X av++; ac--; X if (*av) X recfile = *av; X else X goto usage; X } else if (eq(*av, "-i")) { X record_english = false; X } else if (eq(*av, "-R")) { X randflag = true; X } else if (eq(*av, "-v")) { X win_flashmove = true; X } else if (eq(*av, "-q")) { X quickflag = true; X } else if (eq(*av, "-t")) { X av++; ac--; X if (*av) { X movesperunit = atoi(*av); X if (s = index(*av, '/')) X timeunit = atoi(s + 1); X else X timeunit = 60; X } else X goto usage; X } else if (eq(*av, "-p")) { X av++; ac--; X if (*av) X progname = *av; X else X goto usage; X } else if (eq(*av, "-h")) { X av++; ac--; X if (*av) X proghost = *av; X else X goto usage; X } else if (eq(*av, "-b")) { X blackflag = true; X } else if (eq(*av, "-c")) { X progflag = true; X } else if (eq(*av, "-bnw")) { X bnwflag = true; X } else if (eq(*av, "-s")) { X saveflag = true; X } else if (eq(*av, "-n")) { X noisyflag = true; X } else X goto usage; X av++; ac--; X } X if (ac > 0) X dispname1 = av[0]; X if (ac > 1) X dispname2 = av[1]; X if (ac > 2) X goto usage; X X if (!dispname2) X oneboard = true; X X srandom(getpid()); X X if (!oneboard && randflag && (random() % 2)) { X s = dispname1; X dispname1 = dispname2; X dispname2 = s; X } X X if (!dispname1) X dispname1 = getenv("DISPLAY"); X X /* Now get boolean defaults... */ X if ((s = XGetDefault(program, "noisy")) && eq(s, "on")) X noisyflag = true; X if ((s = XGetDefault(program, "savemoves")) && eq(s, "on")) X saveflag = true; X if ((s = XGetDefault(program, "algebraic")) && eq(s, "on")) X record_english = false; X if ((s = XGetDefault(program, "blackandwhite")) && eq(s, "on")) X bnwflag = true; X if ((s = XGetDefault(program, "quickrestore")) && eq(s, "on")) X quickflag = true; X if ((s = XGetDefault(program, "flash")) && eq(s, "on")) X win_flashmove = true; X X /* ... numeric variables ... */ X if (s = XGetDefault(program, "numflashes")) X num_flashes = atoi(s); X if (s = XGetDefault(program, "flashsize")) X flash_size = atoi(s); X X /* ... and strings. */ X if (s = XGetDefault(program, "progname")) X progname = s; X if (s = XGetDefault(program, "proghost")) X proghost = s; X if (s = XGetDefault(program, "recordfile")) X recfile = s; X if (s = XGetDefault(program, "blackpiece")) X black_piece_color = s; X if (s = XGetDefault(program, "whitepiece")) X white_piece_color = s; X if (s = XGetDefault(program, "blacksquare")) X black_square_color = s; X if (s = XGetDefault(program, "whitesquare")) X white_square_color = s; X if (s = XGetDefault(program, "bordercolor")) X border_color = s; X if (s = XGetDefault(program, "textcolor")) X text_color = s; X if (s = XGetDefault(program, "textback")) X text_back = s; X if (s = XGetDefault(program, "errortext")) X error_text = s; X if (s = XGetDefault(program, "playertext")) X player_text = s; X if (s = XGetDefault(program, "cursorcolor")) X cursor_color = s; X X /* Set up the board. */ X board_setup(); X X /* Create the windows. */ X win_setup(dispname1, dispname2); X X board_drawall(); X X /* Start the program if necessary. */ X if (progflag) X if (!program_init(progname)) X exit(1); X X XSync(0); X if (recfile) X load_game(recfile); X X /* Go into a loop of prompting players alternately for moves, checking X * them, and updating things. X */ X for (;;) { X win_process(false); X clock_update(); X if (progflag && ((!blackflag && (nexttomove == BLACK)) || X (blackflag && (nexttomove == WHITE)))) { X m = program_get(); X if (m) X prog_move(m); X } X } X Xusage: fprintf(stderr, "Usage: %s\n", USAGE); X exit(1); X} X END_OF_xchess.c if test 6158 -ne `wc -c <xchess.c`; then echo shar: \"xchess.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f xchess_mask.cur -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"xchess_mask.cur\" else echo shar: Extracting \"xchess_mask.cur\" \(236 characters\) sed "s/^X//" >xchess_mask.cur <<'END_OF_xchess_mask.cur' X#define xchess_mask_width 16 X#define xchess_mask_height 16 Xstatic short xchess_mask_bits[] = { X 0x0000, 0x0000, 0x7000, 0xf800, X 0xfe00, 0xff80, 0xffc0, 0xff60, X 0xfdb0, 0x66d8, 0x3b6c, 0x1d76, X 0x1d98, 0x0ccc, 0x0060, 0x0000}; END_OF_xchess_mask.cur if test 236 -ne `wc -c <xchess_mask.cur`; then echo shar: \"xchess_mask.cur\" unpacked with wrong size! fi # end of overwriting check fi echo shar: End of archive 4 \(of 6\). cp /dev/null ark4isdone MISSING="" for I in 1 2 3 4 5 6 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 6 archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0