billr@saab.CNA.TEK.COM (Bill Randle) (11/02/90)
Submitted-by: Rich Burridge <rburridge@sun.COM>
Posting-number: Volume 11, Issue 58
Archive-name: reve/Part07
Environment: SunView, XView, X11, termcap
#! /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 7 (of 7)."
# Contents: TODO images/black.icon images/button.invert.icon
# images/cycle.glyph.icon images/cycle.linvert.icon
# images/cycle.rinvert.icon images/cycle.stencil.icon
# images/hglass.cursor images/nocur.cursor images/reve.icon
# images/white.icon items.c procs.c rev_ip.c
# Wrapped by billr@saab on Thu Nov 1 14:02:55 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'TODO' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'TODO'\"
else
echo shar: Extracting \"'TODO'\" \(1416 characters\)
sed "s/^X//" >'TODO' <<'END_OF_FILE'
X
X/* @(#)TODO 1.8 90/10/18
X *
X * Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X * All rights reserved.
X *
X * Permission is given to distribute these sources, as long as the
X * introductory messages are not removed, and no monies are exchanged.
X *
X * You are forbidden from using Reve as is, or in a modified state, in
X * any tournaments, without the permission of the authors.
X *
X * No responsibility is taken for any errors on inaccuracies inherent
X * either to the comments or the code of this program, but if reported
X * (see README file), then an attempt will be made to fix them.
X */
X
XReve TODO list.
X===============
X
X1/ Finish off the X11 "two screens on two machines" version. The hooks are
X all in place, but not enough spare time...
X
X2/ Allow the computer to play itself. Currently this option is disabled,
X because of the inability with some of the graphics versions to interrupt
X it, once it's started.
X
X3/ From Valerie Haecky <vmh@Eng>
X It might be nice to have an additional button for <help>. It pops up an
X alert, giving a short summary of the rules and explaining things, like
X how Difficulty is measured.
X
X4/ With the XView version, disable MS_LEFT whilst the computer is having
X its move. At the moment, if you press the left mouse button while the
X computer is doing something, the server will hang.
X
X5/ The color icon doesn't display properly with the XView version.
END_OF_FILE
if test 1416 -ne `wc -c <'TODO'`; then
echo shar: \"'TODO'\" unpacked with wrong size!
fi
# end of 'TODO'
fi
if test -f 'images/black.icon' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'images/black.icon'\"
else
echo shar: Extracting \"'images/black.icon'\" \(1933 characters\)
sed "s/^X//" >'images/black.icon' <<'END_OF_FILE'
X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
X */
X 0x0001,0xFF00,0x0000,0x0000,0x000F,0xFFE0,0x0000,0x0000,
X 0x003F,0xFFF8,0x0000,0x0000,0x007F,0xFFFC,0x0000,0x0000,
X 0x01FF,0xFFFF,0x0000,0x0000,0x03FF,0xFFFF,0x8000,0x0000,
X 0x07FF,0xFFFF,0xC000,0x0000,0x0FFF,0xFFFF,0xE000,0x0000,
X 0x0FFF,0xFFFF,0xE000,0x0000,0x1FFF,0xFFFF,0xF000,0x0000,
X 0x3FFF,0xFFFF,0xF800,0x0000,0x3FFF,0xFFFF,0xF800,0x0000,
X 0x7FFF,0xFFFF,0xFC00,0x0000,0x7FFF,0xFFFF,0xFC00,0x0000,
X 0x7FFF,0xFFFF,0xFC00,0x0000,0xFFFF,0xFFFF,0xFE00,0x0000,
X 0xFFFF,0xFFFF,0xFE00,0x0000,0xFFFF,0xFFFF,0xFE00,0x0000,
X 0xFFFF,0xFFFF,0xFE00,0x0000,0xFFFF,0xFFFF,0xFE00,0x0000,
X 0xFFFF,0xFFFF,0xFE00,0x0000,0xFFFF,0xFFFF,0xFE00,0x0000,
X 0xFFFF,0xFFFF,0xFE00,0x0000,0xFFFF,0xFFFF,0xFE00,0x0000,
X 0x7FFF,0xFFFF,0xFC00,0x0000,0x7FFF,0xFFFF,0xFC00,0x0000,
X 0x7FFF,0xFFFF,0xFC00,0x0000,0x3FFF,0xFFFF,0xF800,0x0000,
X 0x3FFF,0xFFFF,0xF800,0x0000,0x1FFF,0xFFFF,0xF000,0x0000,
X 0x0FFF,0xFFFF,0xE000,0x0000,0x0FFF,0xFFFF,0xE000,0x0000,
X 0x07FF,0xFFFF,0xC000,0x0000,0x03FF,0xFFFF,0x8000,0x0000,
X 0x01FF,0xFFFF,0x0000,0x0000,0x007F,0xFFFC,0x0000,0x0000,
X 0x003F,0xFFF8,0x0000,0x0000,0x000F,0xFFE0,0x0000,0x0000,
X 0x0001,0xFF00,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
END_OF_FILE
if test 1933 -ne `wc -c <'images/black.icon'`; then
echo shar: \"'images/black.icon'\" unpacked with wrong size!
fi
# end of 'images/black.icon'
fi
if test -f 'images/button.invert.icon' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'images/button.invert.icon'\"
else
echo shar: Extracting \"'images/button.invert.icon'\" \(1933 characters\)
sed "s/^X//" >'images/button.invert.icon' <<'END_OF_FILE'
X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
X */
X 0x03FF,0xFFFF,0xFFFF,0xFFC0,0x0C00,0x0000,0x0000,0x0030,
X 0x1000,0x0000,0x0000,0x0008,0x23FF,0xFFFF,0xFFFF,0xFFC4,
X 0x47FF,0xFFFF,0xFFFF,0xFFE2,0x4FFF,0xFFFF,0xFFFF,0xFFF2,
X 0x9FFF,0xFFFF,0xFFFF,0xFFF3,0x9FFF,0xFFFF,0xFFFF,0xFFF3,
X 0x9FFF,0xFFFF,0xFFFF,0xFFF3,0x9FFF,0xFFFF,0xFFFF,0xFFF3,
X 0x9FFF,0xFFFF,0xFFFF,0xFFF3,0x9FFF,0xFFFF,0xFFFF,0xFFF3,
X 0x9FFF,0xFFFF,0xFFFF,0xFFF3,0x9FFF,0xFFFF,0xFFFF,0xFFF3,
X 0x9FFF,0xFFFF,0xFFFF,0xFFF3,0x9FFF,0xFFFF,0xFFFF,0xFFF3,
X 0x9FFF,0xFFFF,0xFFFF,0xFFF3,0x9FFF,0xFFFF,0xFFFF,0xFFF3,
X 0x9FFF,0xFFFF,0xFFFF,0xFFF3,0x9FFF,0xFFFF,0xFFFF,0xFFF3,
X 0x9FFF,0xFFFF,0xFFFF,0xFFF3,0x9FFF,0xFFFF,0xFFFF,0xFFF3,
X 0x9FFF,0xFFFF,0xFFFF,0xFFF3,0x9FFF,0xFFFF,0xFFFF,0xFFF3,
X 0x9FFF,0xFFFF,0xFFFF,0xFFF3,0x9FFF,0xFFFF,0xFFFF,0xFFE7,
X 0x4FFF,0xFFFF,0xFFFF,0xFFE6,0x47FF,0xFFFF,0xFFFF,0xFFCE,
X 0x2000,0x0000,0x0000,0x001C,0x1000,0x0000,0x0000,0x0038,
X 0x0FFF,0xFFFF,0xFFFF,0xFFF0,0x03FF,0xFFFF,0xFFFF,0xFFC0,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
END_OF_FILE
if test 1933 -ne `wc -c <'images/button.invert.icon'`; then
echo shar: \"'images/button.invert.icon'\" unpacked with wrong size!
fi
# end of 'images/button.invert.icon'
fi
if test -f 'images/cycle.glyph.icon' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'images/cycle.glyph.icon'\"
else
echo shar: Extracting \"'images/cycle.glyph.icon'\" \(1933 characters\)
sed "s/^X//" >'images/cycle.glyph.icon' <<'END_OF_FILE'
X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
X */
X 0x03FF,0xFFC0,0x0000,0x0000,0x0C01,0x8030,0x0000,0x0000,
X 0x1001,0x8008,0x0000,0x0000,0x2001,0x8004,0x0000,0x0000,
X 0x4001,0x8002,0x0000,0x0000,0x40C1,0xBFF2,0x0000,0x0000,
X 0x80C1,0xA013,0x0000,0x0000,0x8121,0x9023,0x0000,0x0000,
X 0x8121,0x9023,0x0000,0x0000,0x8211,0x8843,0x0000,0x0000,
X 0x8211,0x8843,0x0000,0x0000,0x8409,0x8483,0x0000,0x0000,
X 0x8409,0x8483,0x0000,0x0000,0x8805,0x8303,0x0000,0x0000,
X 0x4FFD,0x8306,0x0000,0x0000,0x4001,0x800E,0x0000,0x0000,
X 0x2001,0x801C,0x0000,0x0000,0x1001,0x8038,0x0000,0x0000,
X 0x0FFF,0xFFF0,0x0000,0x0000,0x03FF,0xFFC0,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
END_OF_FILE
if test 1933 -ne `wc -c <'images/cycle.glyph.icon'`; then
echo shar: \"'images/cycle.glyph.icon'\" unpacked with wrong size!
fi
# end of 'images/cycle.glyph.icon'
fi
if test -f 'images/cycle.linvert.icon' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'images/cycle.linvert.icon'\"
else
echo shar: Extracting \"'images/cycle.linvert.icon'\" \(1933 characters\)
sed "s/^X//" >'images/cycle.linvert.icon' <<'END_OF_FILE'
X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
X */
X 0x03FF,0xFFC0,0x0000,0x0000,0x0C01,0x8030,0x0000,0x0000,
X 0x1001,0x8008,0x0000,0x0000,0x2001,0x8004,0x0000,0x0000,
X 0x4001,0x8002,0x0000,0x0000,0x40C1,0xBFF2,0x0000,0x0000,
X 0x80C1,0xA013,0x0000,0x0000,0x81E1,0x9023,0x0000,0x0000,
X 0x81E1,0x9023,0x0000,0x0000,0x83F1,0x8843,0x0000,0x0000,
X 0x83F1,0x8843,0x0000,0x0000,0x87F9,0x8483,0x0000,0x0000,
X 0x87F9,0x8483,0x0000,0x0000,0x8FFD,0x8303,0x0000,0x0000,
X 0x4FFD,0x8306,0x0000,0x0000,0x4001,0x800E,0x0000,0x0000,
X 0x2001,0x801C,0x0000,0x0000,0x1001,0x8038,0x0000,0x0000,
X 0x0FFF,0xFFF0,0x0000,0x0000,0x03FF,0xFFC0,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
END_OF_FILE
if test 1933 -ne `wc -c <'images/cycle.linvert.icon'`; then
echo shar: \"'images/cycle.linvert.icon'\" unpacked with wrong size!
fi
# end of 'images/cycle.linvert.icon'
fi
if test -f 'images/cycle.rinvert.icon' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'images/cycle.rinvert.icon'\"
else
echo shar: Extracting \"'images/cycle.rinvert.icon'\" \(1933 characters\)
sed "s/^X//" >'images/cycle.rinvert.icon' <<'END_OF_FILE'
X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
X */
X 0x03FF,0xFFC0,0x0000,0x0000,0x0C01,0x8030,0x0000,0x0000,
X 0x1001,0x8008,0x0000,0x0000,0x2001,0x8004,0x0000,0x0000,
X 0x4001,0x8002,0x0000,0x0000,0x40C1,0xBFF2,0x0000,0x0000,
X 0x80C1,0xBFF3,0x0000,0x0000,0x8121,0x9FE3,0x0000,0x0000,
X 0x8121,0x9FE3,0x0000,0x0000,0x8211,0x8FC3,0x0000,0x0000,
X 0x8211,0x8FC3,0x0000,0x0000,0x8409,0x8783,0x0000,0x0000,
X 0x8409,0x8783,0x0000,0x0000,0x8805,0x8303,0x0000,0x0000,
X 0x4FFD,0x8306,0x0000,0x0000,0x4001,0x800E,0x0000,0x0000,
X 0x2001,0x801C,0x0000,0x0000,0x1001,0x8038,0x0000,0x0000,
X 0x0FFF,0xFFF0,0x0000,0x0000,0x03FF,0xFFC0,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
END_OF_FILE
if test 1933 -ne `wc -c <'images/cycle.rinvert.icon'`; then
echo shar: \"'images/cycle.rinvert.icon'\" unpacked with wrong size!
fi
# end of 'images/cycle.rinvert.icon'
fi
if test -f 'images/cycle.stencil.icon' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'images/cycle.stencil.icon'\"
else
echo shar: Extracting \"'images/cycle.stencil.icon'\" \(1933 characters\)
sed "s/^X//" >'images/cycle.stencil.icon' <<'END_OF_FILE'
X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
X */
X 0x03FF,0xFFC0,0x0000,0x0000,0x0FFF,0xFFF0,0x0000,0x0000,
X 0x1FFF,0xFFF8,0x0000,0x0000,0x3FFF,0xFFFC,0x0000,0x0000,
X 0x7FFF,0xFFFE,0x0000,0x0000,0x7FFF,0xFFFE,0x0000,0x0000,
X 0xFFFF,0xFFFF,0x0000,0x0000,0xFFFF,0xFFFF,0x0000,0x0000,
X 0xFFFF,0xFFFF,0x0000,0x0000,0xFFFF,0xFFFF,0x0000,0x0000,
X 0xFFFF,0xFFFF,0x0000,0x0000,0xFFFF,0xFFFF,0x0000,0x0000,
X 0xFFFF,0xFFFF,0x0000,0x0000,0xFFFF,0xFFFF,0x0000,0x0000,
X 0x7FFF,0xFFFE,0x0000,0x0000,0x7FFF,0xFFFE,0x0000,0x0000,
X 0x3FFF,0xFFFC,0x0000,0x0000,0x1FFF,0xFFF8,0x0000,0x0000,
X 0x0FFF,0xFFF0,0x0000,0x0000,0x03FF,0xFFC0,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
END_OF_FILE
if test 1933 -ne `wc -c <'images/cycle.stencil.icon'`; then
echo shar: \"'images/cycle.stencil.icon'\" unpacked with wrong size!
fi
# end of 'images/cycle.stencil.icon'
fi
if test -f 'images/hglass.cursor' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'images/hglass.cursor'\"
else
echo shar: Extracting \"'images/hglass.cursor'\" \(193 characters\)
sed "s/^X//" >'images/hglass.cursor' <<'END_OF_FILE'
X/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
X */
X 0x7FFE,0x4002,0x200C,0x1A38,0x0FF0,0x07E0,0x03C0,0x0180,
X 0x0180,0x0240,0x0520,0x0810,0x1108,0x23C4,0x47E2,0x7FFE
END_OF_FILE
if test 193 -ne `wc -c <'images/hglass.cursor'`; then
echo shar: \"'images/hglass.cursor'\" unpacked with wrong size!
fi
# end of 'images/hglass.cursor'
fi
if test -f 'images/nocur.cursor' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'images/nocur.cursor'\"
else
echo shar: Extracting \"'images/nocur.cursor'\" \(193 characters\)
sed "s/^X//" >'images/nocur.cursor' <<'END_OF_FILE'
X/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
X */
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
END_OF_FILE
if test 193 -ne `wc -c <'images/nocur.cursor'`; then
echo shar: \"'images/nocur.cursor'\" unpacked with wrong size!
fi
# end of 'images/nocur.cursor'
fi
if test -f 'images/reve.icon' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'images/reve.icon'\"
else
echo shar: Extracting \"'images/reve.icon'\" \(1933 characters\)
sed "s/^X//" >'images/reve.icon' <<'END_OF_FILE'
X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
X */
X 0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8001,0x0001,0x0001,0x0001,
X 0x8001,0x0001,0x0001,0x0001,0x8001,0x0001,0x0001,0x0001,
X 0x8001,0x0001,0x0001,0x0001,0x8001,0x0001,0x0001,0x0001,
X 0x8001,0x0001,0x0001,0x0001,0x8001,0x0001,0x0001,0x0001,
X 0x8001,0x0001,0x0001,0x0001,0x8001,0x0001,0x0001,0x0001,
X 0x8001,0x0001,0x0001,0x0001,0x8001,0x0001,0x0001,0x0001,
X 0x8001,0x0001,0x0001,0x0001,0x8001,0x0001,0x0001,0x0001,
X 0x8001,0x0001,0x0001,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
X 0x8001,0x0001,0x0001,0x0001,0x8001,0x0001,0x0001,0x0001,
X 0x87C1,0x07C1,0x07C1,0x07C1,0x8821,0x0821,0x0FE1,0x0821,
X 0x9011,0x1011,0x1FF1,0x1011,0xA009,0x2009,0x3FF9,0x2009,
X 0xA009,0x2009,0x3FF9,0x2009,0xA009,0x2009,0x3FF9,0x2009,
X 0xA009,0x2009,0x3FF9,0x2009,0xA009,0x2009,0x3FF9,0x2009,
X 0x9011,0x1011,0x1FF1,0x1011,0x8821,0x0821,0x0FE1,0x0821,
X 0x87C1,0x07C1,0x07C1,0x07C1,0x8001,0x0001,0x0001,0x0001,
X 0x8001,0x0001,0x0001,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
X 0x8001,0x0001,0x0001,0x0001,0x8001,0x0001,0x0001,0x0001,
X 0x8001,0x07C1,0x07C1,0x0001,0x8001,0x0FE1,0x0821,0x0001,
X 0x8001,0x1FF1,0x1011,0x0001,0x8001,0x3FF9,0x2009,0x0001,
X 0x8001,0x3FF9,0x2009,0x0001,0x8001,0x3FF9,0x2009,0x0001,
X 0x8001,0x3FF9,0x2009,0x0001,0x8001,0x3FF9,0x2009,0x0001,
X 0x8001,0x1FF1,0x1011,0x0001,0x8001,0x0FE1,0x0821,0x0001,
X 0x8001,0x07C1,0x07C1,0x0001,0x8001,0x0001,0x0001,0x0001,
X 0x8001,0x0001,0x0001,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
X 0x8001,0x0001,0x0001,0x0001,0x8001,0x0001,0x0001,0x0001,
X 0x87C1,0x0001,0x0001,0x0001,0x8821,0x0001,0x0001,0x0001,
X 0x9011,0x0001,0x0001,0x0001,0xA009,0x0001,0x0001,0x0001,
X 0xA009,0x0001,0x0001,0x0001,0xA009,0x0001,0x0001,0x0001,
X 0xA009,0x0001,0x0001,0x0001,0xA009,0x0001,0x0001,0x0001,
X 0x9011,0x0001,0x0001,0x0001,0x8821,0x0001,0x0001,0x0001,
X 0x87C1,0x0001,0x0001,0x0001,0x8001,0x0001,0x0001,0x0001,
X 0x8001,0x0001,0x0001,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF
END_OF_FILE
if test 1933 -ne `wc -c <'images/reve.icon'`; then
echo shar: \"'images/reve.icon'\" unpacked with wrong size!
fi
# end of 'images/reve.icon'
fi
if test -f 'images/white.icon' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'images/white.icon'\"
else
echo shar: Extracting \"'images/white.icon'\" \(1933 characters\)
sed "s/^X//" >'images/white.icon' <<'END_OF_FILE'
X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
X */
X 0x0001,0xFF00,0x0000,0x0000,0x000E,0x00E0,0x0000,0x0000,
X 0x0030,0x0018,0x0000,0x0000,0x0040,0x0004,0x0000,0x0000,
X 0x0180,0x0003,0x0000,0x0000,0x0200,0x0000,0x8000,0x0000,
X 0x0400,0x0000,0x4000,0x0000,0x0800,0x0000,0x2000,0x0000,
X 0x0800,0x0000,0x2000,0x0000,0x1000,0x0000,0x1000,0x0000,
X 0x2000,0x0000,0x0800,0x0000,0x2000,0x0000,0x0800,0x0000,
X 0x4000,0x0000,0x0400,0x0000,0x4000,0x0000,0x0400,0x0000,
X 0x4000,0x0000,0x0400,0x0000,0x8000,0x0000,0x0200,0x0000,
X 0x8000,0x0000,0x0200,0x0000,0x8000,0x0000,0x0200,0x0000,
X 0x8000,0x0000,0x0200,0x0000,0x8000,0x0000,0x0200,0x0000,
X 0x8000,0x0000,0x0200,0x0000,0x8000,0x0000,0x0200,0x0000,
X 0x8000,0x0000,0x0200,0x0000,0x8000,0x0000,0x0200,0x0000,
X 0x4000,0x0000,0x0400,0x0000,0x4000,0x0000,0x0400,0x0000,
X 0x4000,0x0000,0x0400,0x0000,0x2000,0x0000,0x0800,0x0000,
X 0x2000,0x0000,0x0800,0x0000,0x1000,0x0000,0x1000,0x0000,
X 0x0800,0x0000,0x2000,0x0000,0x0800,0x0000,0x2000,0x0000,
X 0x0400,0x0000,0x4000,0x0000,0x0200,0x0000,0x8000,0x0000,
X 0x0180,0x0003,0x0000,0x0000,0x0040,0x0004,0x0000,0x0000,
X 0x0030,0x0018,0x0000,0x0000,0x000E,0x00E0,0x0000,0x0000,
X 0x0001,0xFF00,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
END_OF_FILE
if test 1933 -ne `wc -c <'images/white.icon'`; then
echo shar: \"'images/white.icon'\" unpacked with wrong size!
fi
# end of 'images/white.icon'
fi
if test -f 'items.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'items.c'\"
else
echo shar: Extracting \"'items.c'\" \(7599 characters\)
sed "s/^X//" >'items.c' <<'END_OF_FILE'
X/*LINTLIBRARY*/
X
X/* @(#)items.c 1.9 90/10/20
X *
X * Procedures for manipulating the reve game panel items.
X *
X * Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X * All rights reserved.
X *
X * Permission is given to distribute these sources, as long as the
X * introductory messages are not removed, and no monies are exchanged.
X *
X * You are forbidden from using Reve as is, or in a modified state, in
X * any tournaments, without the permission of the authors.
X *
X * No responsibility is taken for any errors on inaccuracies inherent
X * either to the comments or the code of this program, but if reported
X * (see README file), then an attempt will be made to fix them.
X */
X
X#include <stdio.h>
X#include <strings.h>
X#include "color.h"
X#include "reve.h"
X#include "extern.h"
X
X
Xvoid
Xdraw_button(item, color, image) /* Draw a panel button. */
Xenum panel_type item ;
Xint color ;
Xenum image_type image ;
X{
X char *label ;
X int x, y ;
X
X x = items[(int) item].x ;
X y = items[(int) item].y ;
X if (iscolor[(int) cur_dpyno])
X {
X draw_stencil(x, y, BWIDTH, BHEIGHT, RSRC, color,
X BUT_STENCIL, BUT_STENCIL) ;
X draw_image(x, y, BWIDTH, BHEIGHT, image) ;
X }
X else draw_stencil(x, y, BWIDTH, BHEIGHT, RSRC, C_WHITE, BUT_STENCIL, image) ;
X label = items[(int) item].text ;
X if (image == BUT_INVERT) color = C_WHITE ;
X else color = C_BLACK ;
X x += ((BWIDTH - get_strwidth(NFONT, label)) / 2) ;
X y += (nfont_height + (BHEIGHT - nfont_height) / 2) - 5 ;
X draw_text(x, y, NFONT, color, label) ;
X}
X
X
Xvoid
Xdraw_cycle(item, color, image)
Xenum panel_type item ;
Xint color ;
Xenum image_type image ;
X{
X int x, y ;
X
X x = items[(int) item].x + (3 * BWIDTH) + (2 * BGAP) - CWIDTH ;
X y = items[(int) item].y ;
X if (iscolor[(int) cur_dpyno])
X {
X draw_stencil(x, y, CWIDTH, CHEIGHT, RSRC, color, CY_STENCIL, CY_STENCIL) ;
X draw_image(x, y, CWIDTH, CHEIGHT, image) ;
X }
X else draw_stencil(x, y, CWIDTH, CHEIGHT, RSRC, C_WHITE, CY_STENCIL, image) ;
X}
X
X
Xvoid
Xdraw_cycle_item(item, choices, color, image) /* Display cycle panel item. */
Xenum panel_type item ;
Xchar *choices[] ;
Xint color ;
Xenum image_type image ;
X{
X char *label ;
X int n, x, y ;
X
X n = (int) item ;
X label = items[n].text ;
X x = items[n].x ;
X y = items[n].y ;
X draw_text(x, y + bfont_height, BFONT, C_BLACK, label) ;
X set_cycle(item, choices[items[n].value]) ;
X draw_cycle(item, color, image) ;
X}
X
X
Xvoid
Xdraw_filename(str) /* Output filename in text field. */
Xchar *str ;
X{
X int y ;
X
X color_area(tx + 1, ty + 1, tw - 2, th - 2, C_WHITE) ;
X y = ty + (nfont_height + (th - nfont_height) / 2) - 5 ;
X draw_text(tx + 5, y, NFONT, C_BLACK, str) ;
X draw_line(tx + 5 + get_strwidth(NFONT, str), y + 5,
X tx + 5 + get_strwidth(NFONT, str), y + 5 - nfont_height,
X RSRC, C_BLACK) ;
X}
X
X
Xvoid
Xdraw_piece(piece, x, y, op) /* Draw an othello piece on the board. */
Xint piece, x, y ;
Xenum optype op ;
X{
X switch (piece)
X {
X case BLACK : draw_stencil(x, y, PSIZE, PSIZE, op, C_BLACK,
X P_BLACK, P_BLACK) ;
X break ;
X case WHITE : draw_stencil(x, y, PSIZE, PSIZE, op, C_BLACK,
X P_BLACK, P_WHITE) ;
X }
X}
X
X
Xvoid
Xdraw_rect(x1, y1, x2, y2)
Xint x1, y1, x2, y2 ;
X{
X draw_line(x1, y1, x2, y1, RSRC, C_BLACK) ;
X draw_line(x1, y1, x1, y2, RSRC, C_BLACK) ;
X draw_line(x2, y1, x2, y2, RSRC, C_BLACK) ;
X draw_line(x1, y2, x2, y2, RSRC, C_BLACK) ;
X}
X
X
Xvoid
Xdraw_textfield()
X{
X int x1, y1 ;
X
X lsval = (curx < (BBORDER + (2*(BWIDTH+BGAP)))) ? 'l' : 's' ;
X x1 = BBORDER + BWIDTH + (BGAP / 2) ;
X y1 = BBORDER + BHEIGHT + (BGAP / 2) ;
X color_area(x1, y1, 4 * (BWIDTH + BGAP), BHEIGHT + BGAP, C_WHITE) ;
X draw_rect(x1, y1, x1 + (4 * (BWIDTH + BGAP)) - 1, y1 + BHEIGHT + BGAP - 1) ;
X draw_text(BBORDER + BWIDTH + BGAP, BBORDER + BHEIGHT + BGAP +
X (nfont_height + (BHEIGHT - nfont_height) / 2) - 5,
X BFONT, C_BLACK, "File:") ;
X tx = BBORDER + BWIDTH + BGAP + (BWIDTH / 2) + 10 ;
X ty = BBORDER + BHEIGHT + BGAP ;
X tw = (BWIDTH / 2) - 10 + (2 * (BWIDTH + BGAP)) ;
X th = BHEIGHT ;
X draw_rect(tx, ty, tx + tw, ty + th) ;
X draw_filename(gamefile) ;
X
X tinput = 1 ;
X items[(int) CANCEL_BUT].x = BBORDER + (4*(BWIDTH+BGAP)) ;
X items[(int) CANCEL_BUT].y = BBORDER + (1*(BHEIGHT+BGAP)) ;
X draw_button(CANCEL_BUT, C_LGREY, BUT_NORMAL) ;
X}
X
X
Xvoid
Xget_filename() /* Extract next character for load/save filename. */
X{
X char c, dummy[MAXLINE] ;
X int finished, nochars ;
X
X finished = 0 ;
X c = cur_ch ;
X if (c == ESCAPE)
X {
X remove_textfield() ;
X return ;
X }
X if (c == BACKSPACE || c == DEL)
X gamefile[strlen(gamefile)-1] = '\0' ;
X else if (c == RETURN || c == LINEFEED) finished = 1 ;
X else if (c >= 32) STRNCAT(gamefile, &c, 1) ;
X nochars = (strlen(gamefile) <= 20) ? strlen(gamefile) : 20 ;
X STRNCPY(dummy, &gamefile[strlen(gamefile) - nochars], nochars) ;
X dummy[nochars] = '\0' ;
X draw_filename(dummy) ;
X
X if (finished)
X {
X if (lsval == 'l') load_game() ;
X else if (lsval == 's') save_game() ;
X remove_textfield() ;
X }
X}
X
X
Xvoid
Xmake_message(item) /* Display a message panel. */
Xenum panel_type item ;
X{
X char *message ;
X int x, y ;
X
X message = items[(int) item].text ;
X x = items[(int) item].x ;
X y = items[(int) item].y ;
X color = (iscolor[(int) cur_dpyno]) ? C_BEIGE : C_WHITE ;
X color_area(x, y, TOTAL_WIDTH, 15, color) ;
X draw_text(x, y+nfont_height, NFONT, C_BLACK, message) ;
X}
X
X
Xvoid
Xmake_panel()
X{
X draw_button(LAST_BUT, C_LGREY, BUT_NORMAL) ;
X draw_button(LOAD_BUT, C_LGREY, BUT_NORMAL) ;
X draw_button(NEW_GAME_BUT, C_LGREY, BUT_NORMAL) ;
X draw_button(SAVE_BUT, C_LGREY, BUT_NORMAL) ;
X draw_button(SUGGEST_BUT, C_LGREY, BUT_NORMAL) ;
X draw_button(UNDO_BUT, C_LGREY, BUT_NORMAL) ;
X
X draw_button(DONE_BUT, C_LGREY, BUT_NORMAL) ;
X draw_button(QUIT_BUT, C_LGREY, BUT_NORMAL) ;
X
X draw_cycle_item(BLACK_PLAYS, player_values, C_LGREY, CY_NORMAL) ;
X draw_cycle_item(WHITE_PLAYS, player_values, C_LGREY, CY_NORMAL) ;
X draw_cycle_item(DIFFICULTY, diff_values, C_LGREY, CY_NORMAL) ;
X draw_cycle_item(NOTES, notes_values, C_LGREY, CY_NORMAL) ;
X
X make_message(PANEL_MES) ;
X make_message(NOTES_MES) ;
X make_message(SCORE_MES) ;
X make_message(TURN_MES) ;
X}
X
X
Xvoid
Xmessage(mtype, str)
Xenum panel_type mtype ;
Xchar *str ;
X{
X int n ;
X
X n = (int) mtype ;
X color = (iscolor[(int) cur_dpyno]) ? C_BEIGE : C_WHITE ;
X color_area(items[n].x, items[n].y,
X get_strwidth(NFONT, items[n].text), nfont_height + 5, color) ;
X draw_text(items[n].x, items[n].y + nfont_height, NFONT, C_BLACK, str) ;
X STRCPY(items[n].text, str) ;
X}
X
X
Xvoid
Xremove_textfield()
X{
X int x1, y1 ;
X
X x1 = BBORDER + BWIDTH + (BGAP / 2) ;
X y1 = BBORDER + BHEIGHT + (BGAP / 2) ;
X color_area(x1, y1, 4 * (BWIDTH + BGAP), BHEIGHT + BGAP,
X (iscolor[(int) cur_dpyno]) ? C_BEIGE : C_WHITE) ;
X tinput = 0 ;
X items[(int) CANCEL_BUT].x = -1 ;
X items[(int) CANCEL_BUT].y = -1 ;
X}
X
X
Xvoid
Xset_cycle(mtype, str)
Xenum panel_type mtype ;
Xchar *str ;
X{
X int n, width, x ;
X
X n = (int) mtype ;
X color = (iscolor[(int) cur_dpyno]) ? C_BEIGE : C_WHITE ;
X
X width = (3 * BWIDTH) + (2 * BGAP) -
X get_strwidth(BFONT, items[n].text) - CWIDTH ;
X x = items[n].x + get_strwidth(BFONT, items[n].text) ;
X color_area(x, items[n].y, width, items[n].height, color) ;
X
X width = get_strwidth(NFONT, str) ;
X x = items[n].x + (3 * BWIDTH) + (2 * BGAP) - CWIDTH - width ;
X draw_text(x - 5, items[n].y + nfont_height, NFONT, C_BLACK, str) ;
X}
END_OF_FILE
if test 7599 -ne `wc -c <'items.c'`; then
echo shar: \"'items.c'\" unpacked with wrong size!
fi
# end of 'items.c'
fi
if test -f 'procs.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'procs.c'\"
else
echo shar: Extracting \"'procs.c'\" \(7287 characters\)
sed "s/^X//" >'procs.c' <<'END_OF_FILE'
X/*LINTLIBRARY*/
X
X/* @(#)procs.c 1.8 90/10/20
X *
X * Procedures associated with the reve game panel items.
X *
X * Copyright (C) 1990 - Rich Burridge & Yves Gallot.
X * All rights reserved.
X *
X * Permission is given to distribute these sources, as long as the
X * introductory messages are not removed, and no monies are exchanged.
X *
X * You are forbidden from using Reve as is, or in a modified state, in
X * any tournaments, without the permission of the authors.
X *
X * No responsibility is taken for any errors on inaccuracies inherent
X * either to the comments or the code of this program, but if reported
X * (see README file), then an attempt will be made to fix them.
X */
X
X#include <stdio.h>
X#include "color.h"
X#include "reve.h"
X#include "extern.h"
X
X
Xvoid
Xdifficulty()
X{
X depth = next_setting(DIFFICULTY, diff_values) + 1 ;
X}
X
X
Xvoid
Xdo_selection(state)
Xint state ;
X{
X int cx, cy ;
X
X set_cursor(CANVASCUR) ;
X if (state == LEFT_DOWN)
X {
X draw_piece(next_player, piece_x, piece_y, RINV) ;
X cmode = (enum cantype) ((int) cmode - 1) ;
X }
X else
X {
X draw_piece(next_player, piece_x, piece_y, RINV) ;
X cx = (piece_x + PIECE_RAD) / CELL_SIZE ;
X cy = ((piece_y - CY) + PIECE_RAD) / CELL_SIZE ;
X move = cy * BOARD_SIZE + cx ;
X make_move() ;
X }
X}
X
X
Xvoid
Xdone()
X{
X iconic = 1 ;
X close_frame() ;
X}
X
X
Xvoid
Xinit_notes()
X{
X show_notes = next_setting(NOTES, notes_values) ;
X if (show_notes == FALSE) message(NOTES_MES, "") ;
X}
X
X
Xvoid
Xinit_player()
X{
X enum panel_type item, other ;
X int curi, curo ;
X
X/* XXX: Currently computer vs computer is not implemented, because of the
X * inability to break out of it, once started, with some of the
X * graphics versions. If the user has asked for this, then force it
X * to toggle the other player, so this situation can't happen.
X */
X
X if (curx < (BBORDER + (3*(BWIDTH+BGAP))))
X {
X item = BLACK_PLAYS ;
X other = WHITE_PLAYS ;
X }
X else
X {
X item = WHITE_PLAYS ;
X other = BLACK_PLAYS ;
X }
X curo = items[(int) other].value ;
X curi = next_setting(item, player_values) ;
X if (curi == COMPUTER && curo == COMPUTER)
X {
X curi = HUMAN ;
X set_cycle(item, player_values[curi]) ;
X items[(int) item].value = curi ;
X message(PANEL_MES, "Computer can't play both players.") ;
X }
X if (curi == HUMAN && curo == COMPUTER)
X dtype = (next_player == BLACK) ? XBLACK : XWHITE ;
X else if (curi == COMPUTER && curo == HUMAN)
X dtype = (next_player == BLACK) ? XWHITE : XBLACK ;
X else if (curi == HUMAN && curo == HUMAN)
X dtype = (dtype == XTWO) ? XTWO : XBOTH ;
X
X if (curi == COMPUTER)
X if ((item == BLACK_PLAYS && cmode == BLACK_START) ||
X (item == WHITE_PLAYS && cmode == WHITE_START))
X computer_move(next_player) ;
X}
X
X
Xvoid
Xlast()
X{
X enum optype rop ;
X int flips, player, x, y ;
X
X if (last_move == -1) return ; /* No last move. */
X player = board.square[last_move] ;
X for (flips = 0; flips < 4; flips++)
X {
X get_xy(last_move, &x, &y) ;
X rop = flips % 2 ? RSRC : RCLR ;
X draw_piece(player, x, CY+y, rop) ;
X PAUSE ;
X }
X}
X
X
Xvoid
Xmake_move()
X{
X if (legal(move, next_player, &board) == FALSE)
X {
X message(PANEL_MES, "Invalid move") ;
X cmode = (enum cantype) ((int) cmode - 1) ;
X return ;
X }
X do_move(next_player) ;
X
X switch (dtype)
X {
X case XBLACK :
X case XWHITE : computer_move(OPPONENT(next_player)) ;
X return ;
X case XBOTH : if (check(next_player) == TRUE) break ;
X (void) check(OPPONENT(next_player)) ;
X return ;
X case XTWO : FPRINTF(stderr, "Multi display not supported yet.\n") ;
X }
X
X cmode = (enum cantype) (OPPONENT(next_player) + 1) ;
X next_player = OPPONENT(next_player) ;
X}
X
X
Xvoid
Xnew_game()
X{
X initboard() ;
X cmode = BLACK_START ;
X last_move = -1 ;
X if (items[(int) BLACK_PLAYS].value == COMPUTER) first_move = 1 ;
X init_canvas() ;
X message(NOTES_MES, "") ;
X message(PANEL_MES, "Use left mouse button to move") ;
X draw_button(NEW_GAME_BUT, C_LGREY, BUT_NORMAL) ;
X}
X
X
Xnext_setting(item, choices)
Xenum panel_type item ;
Xchar *choices[] ;
X{
X switch (direction)
X {
X case INCREMENT : if (choices[++item_value] != NULL)
X items[(int) item].value++ ;
X else items[(int) item].value = item_value = 0 ;
X break ;
X case DECREMENT : if (--item_value == -1)
X {
X while (choices[++item_value] != NULL) ;
X item_value-- ;
X items[(int) item].value = item_value ;
X }
X else items[(int) item].value-- ;
X break ;
X case NONE : /* Handled elsewhere. */ ;
X }
X set_cycle(item, choices[item_value]) ;
X return(items[(int) item].value) ;
X}
X
X
Xvoid
Xquit()
X{
X destroy_frame() ;
X exit(0) ;
X}
X
X
Xvoid
Xsuggest()
X{
X int player ;
X long note ;
X
X if (cmode == GAME_OVER) return ;
X if (cmode == WHITE_START) player = WHITE ;
X else player = BLACK ;
X play_reve(&board.square[0], player, depth, &suggestion, ¬e) ;
X
X suggest_x = BBORDER + ((suggestion & 7) + 1) * CELL_SIZE - CELL_SIZE / 2 ;
X suggest_y = BBORDER + ((suggestion >> 3) + 1) * CELL_SIZE - CELL_SIZE / 2 ;
X draw_line(suggest_x-5, CY+suggest_y-5,
X suggest_x+5, CY+suggest_y+5, RSRC, C_BLACK) ;
X draw_line(suggest_x-5, CY+suggest_y+5,
X suggest_x+5, CY+suggest_y-5, RSRC, C_BLACK) ;
X}
X
X
Xvoid
Xundo()
X{
X enum panel_type p ;
X
X /* The amount we undo is dependant upon two things:
X *
X * 1/ Whether the opponent is the computer, in which case we undo
X * two "moves". Otherwise we just undo one "move".
X *
X * 2/ A "move" is considered to be all consecutive moves by the opponent.
X */
X
X undo_move(next_player) ;
X p = (next_player == BLACK) ? BLACK_PLAYS : WHITE_PLAYS ;
X if (items[(int) p].value == COMPUTER) undo_move(next_player) ;
X
X set_score() ;
X set_turn(next_player) ;
X}
X
X
Xundo_move(player)
Xint player ;
X{
X int i, n, x, y ;
X
X n = 62 - board.moves_left ;
X while (moves[n-1].player == player) n-- ;
X
X if (n >= 3)
X {
X FOR_BOARD(i) board.square[i] = moves[n].square[i] ;
X board.moves_left = moves[n].moves_left ;
X board.player = moves[n].player ;
X board.move = moves[n].move ;
X board.note = moves[n].note ;
X moves[n+1].move = -1 ;
X
X FOR_BOARD(i) old_board.square[i] = moves[n-1].square[i] ;
X old_board.moves_left = moves[n-1].moves_left ;
X old_board.player = moves[n-1].player ;
X old_board.move = moves[n-1].move ;
X old_board.note = moves[n-1].note ;
X
X if (OPPONENT(player) == BLACK) cmode = BLACK_START ;
X else cmode = WHITE_START ;
X message(PANEL_MES, "") ;
X
X FOR_BOARD(i)
X {
X get_xy(i, &x, &y) ;
X if (board.square[i] == FREE)
X color_area(x, CY+y, PSIZE, PSIZE,
X (iscolor[(int) cur_dpyno]) ? C_LBROWN : C_WHITE) ;
X else draw_piece(board.square[i], x, CY+y, RSRC) ;
X }
X next_player = OPPONENT(board.player) ;
X }
X else message(PANEL_MES, "No moves to undo.") ;
X}
END_OF_FILE
if test 7287 -ne `wc -c <'procs.c'`; then
echo shar: \"'procs.c'\" unpacked with wrong size!
fi
# end of 'procs.c'
fi
if test -f 'rev_ip.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'rev_ip.c'\"
else
echo shar: Extracting \"'rev_ip.c'\" \(7718 characters\)
sed "s/^X//" >'rev_ip.c' <<'END_OF_FILE'
X
X/* @(#)rev_ip.c 1.5 90/10/20
X *
X * Copyright (C) 1990 - Yves Gallot - all rights reserved.
X *
X * Permission is given to distribute these sources, as long as the
X * introductory messages are not removed, and no monies are exchanged.
X *
X * No responsibility is taken for any errors on inaccuracies inherent
X * either to the comments or the code of this program, but if reported
X * (see README file), then an attempt will be made to fix them.
X */
X
X#include <stdio.h>
X#include <sys/types.h>
X#include <sys/time.h>
X#include "reve.h"
X
Xextern time_t time() ;
Xextern int damier[NIVEAUMAX][64] ;
Xextern int tacouleur, macouleur ;
Xextern int mnb, profmax ;
Xextern long c1, c2, c3 ;
X
X/* Reve structure. Play_Reve evaluates a board and returns a move and a note
X * for a given color.
X * It makes an interface between graphic variables and Reve heart variables.
X * It computes a timing function, depending on level used.
X * Then an Alpha-Beta pruning is called and stopped when no time left to Reve.
X * JePlonge and TuPlonges are typical F and G functions of an Alpha-Beta.
X * "Plonger dans un arbre" is the french translation of "to descend in a
X * tree", so I Descend and You Descend.
X */
X
Xstatic int cpiinit[60] = { 0, 0, 7, 7,
X 2, 2, 5, 5, 2, 2, 3, 3,
X 4, 4, 5, 5, 1, 1, 3, 3,
X 4, 4, 6, 6, 1, 1, 2, 2,
X 5, 5, 6, 6, 0, 0, 0, 0,
X 2, 3, 4, 5, 2, 3, 4, 5,
X 7, 7, 7, 7, 1, 1, 6, 6,
X 0, 0, 1, 1, 6, 6, 7, 7
X } ;
X
Xstatic int cpjinit[60] = { 0, 7, 0, 7,
X 2, 5, 2, 5, 3, 4, 2, 5,
X 2, 5, 3, 4, 3, 4, 1, 6,
X 1, 6, 3, 4, 2, 5, 1, 6,
X 1, 6, 2, 5, 2, 3, 4, 5,
X 0, 0, 0, 0, 7, 7, 7, 7,
X 2, 3, 4, 5, 1, 6, 1, 6,
X 1, 6, 0, 7, 0, 7, 1, 6
X } ;
X
X/* Total amount of time (in minutes) to allow, at this level of difficulty.
X * The time allocation function is not used at level 1.
X */
X
Xstatic int timevals[MAXDIFF] = { 0, 1, 3, 5, 10, 15, 20, 30, 60 } ;
X
Xstatic int cpi[60], cpj[60], cpk[60] ;
X
Xstatic int locallevel = -1 ;
Xstatic time_t timeleft ;
X
Xstatic long jeplonge() ;
Xstatic long tuplonges() ;
Xlong evalue() ;
X
Xplay_reve(board, color, level, rtnmv, rtnnote)
Xint *board, color, level, *rtnmv ;
Xlong *rtnnote ;
X{
X register int *d0, *d1 ;
X register int k, cp, cpmax ;
X register long lnote, note ;
X register int count, fact ;
X time_t firsttime, timeused, allotime ;
X
X for (k = 0; k < 60; k++)
X {
X cpi[k] = cpiinit[k] ;
X cpj[k] = cpjinit[k] ;
X cpk[k] = 8 * cpi[k] + cpj[k] ;
X }
X
X d0 = damier[0] ;
X d1 = damier[1] ;
X
X for (k = 0; k < 64; k++)
X {
X if (board[k] == BLACK) d0[k] = BLACK ;
X else if (board[k] == WHITE) d0[k] = WHITE ;
X else d0[k] = FREE ;
X }
X
X if (color == WHITE)
X {
X macouleur = WHITE ;
X tacouleur = BLACK ;
X }
X else
X {
X macouleur = BLACK ;
X tacouleur = WHITE ;
X }
X
X if (jepeuxjouer(0) == FALSE)
X {
X *rtnmv = -1 ;
X return ;
X }
X
X mnb = 1 ;
X for (k = 0; k < 64; k++)
X if ((k != 27) && (k != 28) && (k != 35) && (k != 36))
X if ((d0[k] == WHITE) || (d0[k] == BLACK))
X {
X mnb++ ;
X cp = 0 ;
X while (cpk[cp] != k) cp++ ;
X for ( ; cp < 60; cp++)
X {
X cpi[cp] = cpi[cp + 1] ;
X cpj[cp] = cpj[cp + 1] ;
X cpk[cp] = cpk[cp + 1] ;
X }
X }
X
X if ((locallevel != level) || (mnb == 1) || (mnb == 2))
X {
X timeleft = timevals[level] * 60 ;
X locallevel = level ;
X }
X
X k = 0 ;
X for (cp = 0; cp <= 60 - mnb; cp++)
X if (d0[cpk[cp]] == JPJ) k++ ;
X
X if ((k == 1) || (mnb == 1))
X {
X note = 0 ;
X timeused = profmax = 1 ;
X for (cp = 0; d0[cpk[cp]] != JPJ; cp++) ;
X cpi[0] = cpi[cp] ;
X cpj[0] = cpj[cp] ;
X cpk[0] = cpk[cp] ;
X }
X else
X {
X count = 0 ;
X profmax = 1 ;
X allotime = timeleft * 2 / (60 - mnb) ;
X firsttime = time((time_t *) NULL) ;
X do
X {
X note = -1000000000 ;
X
X c1 = 312 + 6 * (mnb + profmax) ;
X if (mnb + profmax < 25)
X c2 = 1000 * (long) (50 + 2 * (mnb + profmax)) ;
X else
X c2 = 1000 * (long) (75 + mnb + profmax) ;
X c3 = 4 * (50 - mnb - profmax) ;
X
X profmax++ ;
X if (profmax > 55 - mnb) profmax = 61 - mnb ;
X
X for (cp = 0; cp <= 60 - mnb; cp++)
X {
X if (d0[cpk[cp]] == JPJ)
X {
X for (k = 0; k < 64; k++) d1[k] = d0[k] ;
X jejoueen(cpi[cp], cpj[cp], 1) ;
X if (tupeuxjouer(1) == TRUE)
X lnote = tuplonges(1, note, (long) 1000000000) ;
X else if (jepeuxjouer(1) == TRUE)
X lnote = jeplonge(1, note, (long) 1000000000) ;
X else
X lnote = evalue(1) ;
X if (lnote > note)
X {
X note = lnote ;
X cpmax = cp ;
X }
X }
X }
X if (cpmax == 0) count++ ;
X else
X {
X count = 1 ;
X k = cpi[0] ;
X cpi[0] = cpi[cpmax] ;
X cpi[cpmax] = k ;
X k = cpj[0] ;
X cpj[0] = cpj[cpmax] ;
X cpj[cpmax] = k ;
X k = cpk[0] ;
X cpk[0] = cpk[cpmax] ;
X cpk[cpmax] = k ;
X }
X timeused = time((time_t *) NULL) - firsttime ;
X if (count < 3) fact = 1 ;
X else fact = 3 ;
X }
X while ((timeused * fact < allotime) && (profmax <= 60 - mnb)) ;
X if (timeused == 0) timeused = 1 ;
X }
X
X timeleft -= timeused ;
X
X *rtnmv = cpk[0] ;
X *rtnnote = note ;
X}
X
X
Xstatic long
Xtuplonges(niv, alpha, beta)
Xint niv ;
Xlong alpha, beta ;
X{
X register int *d0, *d1 ;
X register int k, cp ;
X register long lnote, note ;
X
X d0 = damier[niv] ;
X d1 = damier[niv + 1] ;
X
X note = beta ;
X
X for (cp = 0; cp <= 60 - mnb; cp++)
X {
X if (d0[cpk[cp]] == TPJ)
X {
X for (k = 0; k < 64; k++) d1[k] = d0[k] ;
X tujouesen(cpi[cp], cpj[cp], niv + 1) ;
X if (niv == profmax) lnote = evalue(niv + 1) ;
X else if (jepeuxjouer(niv + 1) == TRUE)
X lnote = jeplonge(niv + 1, alpha, note) ;
X else if (tupeuxjouer(niv + 1) == TRUE)
X lnote = tuplonges(niv + 1, alpha, note) ;
X else
X lnote = evalue(niv + 1) ;
X if (lnote < note) note = lnote ;
X if (note <= alpha) return note ;
X }
X }
X return note ;
X}
X
X
Xstatic long
Xjeplonge(niv, alpha, beta)
Xint niv ;
Xlong alpha, beta ;
X{
X register int *d0, *d1 ;
X register int k, cp ;
X register long lnote, note ;
X
X d0 = damier[niv] ;
X d1 = damier[niv + 1] ;
X
X note = alpha ;
X
X for (cp = 0; cp <= 60 - mnb; cp++)
X {
X if (d0[cpk[cp]] == JPJ)
X {
X for (k = 0; k < 64; k++) d1[k] = d0[k] ;
X jejoueen(cpi[cp], cpj[cp], niv + 1) ;
X if (niv == profmax) lnote = evalue(niv + 1) ;
X else if (tupeuxjouer(niv + 1) == TRUE)
X lnote = tuplonges(niv + 1, note, beta) ;
X else if (jepeuxjouer(niv + 1) == TRUE)
X lnote = jeplonge(niv + 1, note, beta) ;
X else
X lnote = evalue(niv + 1) ;
X if (lnote > note) note = lnote ;
X if (note >= beta) return note ;
X }
X }
X return note ;
X}
END_OF_FILE
if test 7718 -ne `wc -c <'rev_ip.c'`; then
echo shar: \"'rev_ip.c'\" unpacked with wrong size!
fi
# end of 'rev_ip.c'
fi
echo shar: End of archive 7 \(of 7\).
cp /dev/null ark7isdone
MISSING=""
for I in 1 2 3 4 5 6 7 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 7 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