Clean up deleted files.

This commit is contained in:
mycroft 1995-03-01 00:00:00 +00:00
parent 5c42185b5c
commit 4c34be6b52
2170 changed files with 0 additions and 746428 deletions

View File

@ -1,6 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \e3.d
E
w \e3.o
EOT

View File

@ -1 +0,0 @@
E !echo hello world-

View File

@ -1,11 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \g1.d
g/./m0
g/./s/$/\
hello world
g/hello /s/lo/p!/\
a\
order
w \g1.o
EOT

View File

@ -1,15 +0,0 @@
line5
help! world
order
line 4
help! world
order
line 3
help! world
order
line 2
help! world
order
line 1
help! world
order

View File

@ -1,7 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \g2.d
g/[2-4]/-1,+1c\
hello world
w \g2.o
EOT

View File

@ -1 +0,0 @@
hello world

View File

@ -1,14 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \i.d
1i
hello world
.
2i
hello world!
.
$i
hello world!!
.
w \i.o
EOT

View File

@ -1,8 +0,0 @@
hello world
hello world!
line 1
line 2
line 3
line 4
hello world!!
line5

View File

@ -1,7 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \j.d
1,1j
2,3j
w \j.o
EOT

View File

@ -1,4 +0,0 @@
line 1
line 2line 3
line 4
line5

View File

@ -1,5 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \l.d
w \l.o
EOT

View File

View File

@ -1,12 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \m.d
1,2m$
1,2m$
1,2m$
$m0
$m0
2,3m1
2,3m3
w \m.o
EOT

View File

@ -1,5 +0,0 @@
line5
line 1
line 2
line 3
line 4

View File

@ -1,5 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \n.d
w \n.o
EOT

View File

View File

@ -1,8 +0,0 @@
line 1
line 2
line 3
hello world
line 4
line5

View File

@ -1,8 +0,0 @@
1
a
hello world
.

View File

@ -1,5 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \p.d
w \p.o
EOT

View File

View File

@ -1,8 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \r1.d
1;r !echo hello world
1
r !echo hello world
w \r1.o
EOT

View File

@ -1,7 +0,0 @@
line 1
hello world
line 2
line 3
line 4
line5
hello world

View File

@ -1,6 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \r2.d
r
w \r2.o
EOT

View File

@ -1,10 +0,0 @@
line 1
line 2
line 3
line 4
line5
line 1
line 2
line 3
line 4
line5

View File

@ -1,6 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \r3.d
r r3.t
w \r3.o
EOT

View File

@ -1,2 +0,0 @@
r r3.t
r r3.t

View File

@ -1,11 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \s1.d
s/\([^ ][^ ]*\)/(\1)/g
2s
/3/s
/\(4\)/sr
/\(.\)/srg
%s/i/&e/
w \s1.o
EOT

View File

@ -1,5 +0,0 @@
liene 1
(liene) (2)
(liene) (3)
liene (4)
(()liene5)

View File

@ -1,9 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \s2.d
,s/./(&)/3
s/$/00
2s//%/g
s/^l
w \s2.o
EOT

View File

@ -1,5 +0,0 @@
li(n)e 1
i(n)e 200
li(n)e 3
li(n)e 4
li(n)e500

View File

@ -1,8 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \t.d
1t1
2,3t2
,t$
w \t.o
EOT

View File

@ -1,16 +0,0 @@
line 1
line 1
line 1
line 2
line 2
line 3
line 4
line5
line 1
line 1
line 1
line 2
line 2
line 3
line 4
line5

View File

@ -1,3 +0,0 @@
1t1
2,3t2
,t$

View File

@ -1,36 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \u.d
1;r u.t
u
a
hello
world
.
g/./s//x/\
a\
hello\
world
u
u
u
a
hello world!
.
u
1,$d
u
2,3d
u
c
hello world!!
.
u
u
-1;.,+1j
u
u
u
.,+1t$
w \u.o
EOT

View File

@ -1,9 +0,0 @@
line 1
hello
hello world!!
line 2
line 3
line 4
line5
hello
hello world!!

View File

@ -1,11 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \v.d
v/[ ]/m0
v/[ ]/s/$/\
hello world
v/hello /s/lo/p!/\
a\
order
w \v.o
EOT

View File

@ -1,11 +0,0 @@
line5
order
hello world
line 1
order
line 2
order
line 3
order
line 4
order

View File

@ -1,7 +0,0 @@
#!/bin/sh -
../ed - <<\EOT
r \w.d
w !cat >\!.z
r \!.z
w \w.o
EOT

View File

@ -1,10 +0,0 @@
line 1
line 2
line 3
line 4
line5
line 1
line 2
line 3
line 4
line5

View File

@ -1,2 +0,0 @@
parenthesis are broken
not well tested, may have other obscure flaws

View File

@ -1,71 +0,0 @@
#define bishop_mask_width 80
#define bishop_mask_height 80
static char bishop_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0x8f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xc0, 0xdf, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xdf,
0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xdf, 0x1f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xdf, 0x1f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xc0, 0xdf, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0x8f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xc0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff,
0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x3f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xc0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0xfc, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff,
0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf8, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff,
0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x1f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff,
0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x1f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfc, 0x3f, 0xfc, 0xff, 0xe3, 0xff, 0x03, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x01, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0x01,
0x00, 0xf8, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0x01, 0x00, 0xe0,
0xff, 0xff, 0x7f, 0xf8, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xf0, 0x1f, 0xf8,
0x1f, 0xe0, 0xff, 0x80, 0xff, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0xf8, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,71 +0,0 @@
#define bishop_outline_width 80
#define bishop_outline_height 80
static char bishop_outline_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8d,
0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x88, 0x08, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8d, 0x0d, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x0f, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x98,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x70, 0x10, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x40, 0x10, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x18, 0xc0, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x08, 0x80, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0c, 0x80, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80,
0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x22, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x66, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x05, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x01, 0x05, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0xe0, 0x3d, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x20,
0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xe0, 0x3d, 0x50, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x05, 0x70, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x20, 0x00, 0x05, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x20, 0x00, 0x05, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x00, 0x05, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x05, 0x40, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xc0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x10, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x30, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x07,
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8d, 0x03, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8d, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x06, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x02, 0x02, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0c, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xc0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x08,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x18, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x18, 0xc7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f,
0x0c, 0x85, 0xc1, 0xff, 0x01, 0x00, 0x00, 0x00, 0x0e, 0xf0, 0x87, 0x0d,
0x7f, 0x00, 0x07, 0x00, 0x00, 0xc0, 0x03, 0x00, 0xc0, 0x08, 0x00, 0x00,
0x3c, 0x00, 0x00, 0x70, 0x00, 0x00, 0xe0, 0x18, 0x00, 0x00, 0xe0, 0x00,
0x00, 0xc0, 0xf8, 0x1f, 0x38, 0x70, 0xc0, 0xff, 0x31, 0x00, 0x00, 0x80,
0x0f, 0xf0, 0x0f, 0xc0, 0x7f, 0x00, 0x1f, 0x00, 0x00, 0xc0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,15 +0,0 @@
#define bishop_small_width 32
#define bishop_small_height 32
static char bishop_small_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x1c, 0x00, 0x00, 0x70, 0x1c, 0x00,
0x00, 0x70, 0x1c, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x60, 0x16, 0x00,
0x00, 0x60, 0x22, 0x00, 0x00, 0xf0, 0x23, 0x00, 0x00, 0xf0, 0x21, 0x00,
0x00, 0xf8, 0x21, 0x00, 0x00, 0xf8, 0x23, 0x00, 0x00, 0xf8, 0x23, 0x00,
0x00, 0xf8, 0x27, 0x00, 0x00, 0x38, 0x27, 0x00, 0x00, 0x3c, 0x2f, 0x00,
0x00, 0x0c, 0x2c, 0x00, 0x00, 0x0e, 0x3c, 0x00, 0x00, 0x3e, 0x3f, 0x00,
0x00, 0x3e, 0x3f, 0x00, 0x00, 0x3e, 0x3f, 0x00, 0x00, 0x3e, 0x3f, 0x00,
0x00, 0xfe, 0x7f, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xfe, 0x7f, 0x00,
0x00, 0xfe, 0x7f, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xfe, 0x7f, 0x00,
0x00, 0xfe, 0x7f, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0xe0, 0xff, 0xff, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,15 +0,0 @@
#define bishop_small_outline_width 32
#define bishop_small_outline_height 32
static char bishop_small_outline_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x1c, 0x00, 0x00, 0x50, 0x14, 0x00,
0x00, 0x70, 0x1c, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x60, 0x16, 0x00,
0x00, 0x60, 0x22, 0x00, 0x00, 0xf0, 0x23, 0x00, 0x00, 0x10, 0x21, 0x00,
0x00, 0x18, 0x21, 0x00, 0x00, 0x08, 0x23, 0x00, 0x00, 0x08, 0x22, 0x00,
0x00, 0x08, 0x26, 0x00, 0x00, 0x08, 0x24, 0x00, 0x00, 0xcc, 0x2c, 0x00,
0x00, 0xc4, 0x28, 0x00, 0x00, 0xf6, 0x3b, 0x00, 0x00, 0xf2, 0x23, 0x00,
0x00, 0xc2, 0x20, 0x00, 0x00, 0xc2, 0x20, 0x00, 0x00, 0xc2, 0x20, 0x00,
0x00, 0xc2, 0x60, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0x40, 0x00,
0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0x40, 0x00,
0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0x40, 0x00, 0xe0, 0xff, 0xff, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,180 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
static char rcsid[] = "$Id: board.c,v 1.2 1993/08/02 17:20:46 mycroft Exp $";
#endif /* not lint */
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*
* Stuff to deal with the board.
*/
#include "xchess.h"
board *chessboard;
void
board_setup()
{
chessboard = alloc(board);
board_init(chessboard);
return;
}
void
board_init(b)
board *b;
{
int i, j;
for (i = 0; i < 2; i++)
for (j = 0; j < SIZE; j++)
b->square[i][j].color = BLACK;
for (i = 2; i < 6; i++)
for (j = 0; j < SIZE; j++)
b->square[i][j].color = NONE;
for (i = 6; i < 8; i++)
for (j = 0; j < SIZE; j++)
b->square[i][j].color = WHITE;
for (i = 0; i < SIZE; i++)
b->square[1][i].type = b->square[6][i].type =
PAWN;
b->square[0][0].type = b->square[7][0].type = ROOK;
b->square[0][1].type = b->square[7][1].type = KNIGHT;
b->square[0][2].type = b->square[7][2].type = BISHOP;
b->square[0][3].type = b->square[7][3].type = QUEEN;
b->square[0][4].type = b->square[7][4].type = KING;
b->square[0][5].type = b->square[7][5].type = BISHOP;
b->square[0][6].type = b->square[7][6].type = KNIGHT;
b->square[0][7].type = b->square[7][7].type = ROOK;
b->black_cant_castle_k = false;
b->black_cant_castle_q = false;
b->white_cant_castle_k = false;
b->white_cant_castle_q = false;
return;
}
void
board_drawall()
{
int i, j;
for (i = 0; i < SIZE; i++)
for (j = 0; j < SIZE; j++)
if (chessboard->square[i][j].color != NONE) {
win_drawpiece(&chessboard->square[i][j], i,
j, WHITE);
if (!oneboard)
win_drawpiece(&chessboard->square[i][j],
i, j, BLACK);
}
return;
}
void
board_move(b, m)
board *b;
move *m;
{
switch (m->type) {
case MOVE:
case CAPTURE:
b->square[m->fromy][m->fromx].color = NONE;
b->square[m->toy][m->tox].color = m->piece.color;
b->square[m->toy][m->tox].type = m->piece.type;
if ((m->piece.type == PAWN) && (((m->piece.color == BLACK) &&
(m->toy == 7)) || ((m->piece.color == WHITE) &&
(m->toy == 0))))
b->square[m->toy][m->tox].type = QUEEN;
if (m->enpassant)
b->square[m->toy + ((m->piece.color == WHITE) ? 1 :
-1)][m->tox].color = NONE;
break;
case KCASTLE:
if (m->piece.color == WHITE) {
b->square[7][5].color = m->piece.color;
b->square[7][5].type = ROOK;
b->square[7][6].color = m->piece.color;
b->square[7][6].type = KING;
b->square[7][4].color = NONE;
b->square[7][7].color = NONE;
} else {
b->square[0][5].color = m->piece.color;
b->square[0][5].type = ROOK;
b->square[0][6].color = m->piece.color;
b->square[0][6].type = KING;
b->square[0][4].color = NONE;
b->square[0][7].color = NONE;
}
break;
case QCASTLE:
if (m->piece.color == WHITE) {
b->square[7][3].color = m->piece.color;
b->square[7][3].type = ROOK;
b->square[7][2].color = m->piece.color;
b->square[7][2].type = KING;
b->square[7][4].color = NONE;
b->square[7][0].color = NONE;
} else {
b->square[0][3].color = m->piece.color;
b->square[0][3].type = ROOK;
b->square[0][2].color = m->piece.color;
b->square[0][2].type = KING;
b->square[0][4].color = NONE;
b->square[0][0].color = NONE;
}
break;
default:
fprintf(stderr, "Bad move type %d\n", m->type);
}
if (m->piece.type == KING) {
if (m->piece.color == WHITE)
b->white_cant_castle_q =
b->white_cant_castle_k= true;
else
b->black_cant_castle_q =
b->black_cant_castle_k= true;
} else if (m->piece.type == ROOK) {
if (m->piece.color == WHITE) {
if (m->fromx == 0)
b->white_cant_castle_q = true;
else if (m->fromx == 7)
b->white_cant_castle_k = true;
} else {
if (m->fromx == 0)
b->black_cant_castle_q = true;
else if (m->fromx == 7)
b->black_cant_castle_k = true;
}
}
return;
}

View File

@ -1,338 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
static char rcsid[] = "$Id: button.c,v 1.2 1993/08/02 17:20:47 mycroft Exp $";
#endif /* not lint */
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*
* Do stuff with the buttons.
* The configuration we're using is: Draw Back Pause
* Resign Fwd Flip
* Reset Save Easy (Switch)
*/
#include "xchess.h"
typedef enum choice { NOCHOICE, DRAW, RESIGN, REPLAY, SWITCH, FORE, SAVE,
STOP, FLIP, RESTART, EASY } choice;
static struct but {
char *label;
int x, y;
int width, height;
choice which;
} buts[] = {
{ "Draw", 0, 20, 108, 29, DRAW } ,
{ "Back", 109, 20, 108, 29, REPLAY } ,
{ "Pause", 219, 20, 108, 29, STOP } ,
{ "Resign", 0, 50, 108, 29, RESIGN } ,
{ "Fwd", 109, 50, 108, 29, FORE } ,
{ "Flip", 219, 50, 108, 29, FLIP } ,
{ "Reset", 0, 80, 108, 29, RESTART } ,
{ "Save", 109, 80, 108, 29, SAVE } ,
#define EASY_OFFSET 8
{ "Switch", 219, 80, 108, 29, SWITCH }
/* { "NoEasy", 219, 80, 108, 29, EASY }*/
} ;
static int easy = 1;
void
button_draw(win)
windata *win;
{
int i, x, numbuts = sizeof (buts) / sizeof (struct but);
XSetState(win->display, DefaultGC(win->display, 0),
win->border.pixel, WhitePixel(win->display, 0),
GXcopy, AllPlanes);
XSetLineAttributes(win->display, DefaultGC(win->display, 0),
BORDER_WIDTH, LineSolid, CapButt,
JoinMiter);
XDrawLine(win->display, win->buttonwin,
DefaultGC(win->display, 0),
0, 29, BUTTON_WIDTH, 29);
XDrawLine(win->display, win->buttonwin,
DefaultGC(win->display, 0),
0, 60, BUTTON_WIDTH, 60);
XDrawLine(win->display, win->buttonwin,
DefaultGC(win->display, 0),
108, 0, 108, BUTTON_HEIGHT);
XDrawLine(win->display, win->buttonwin,
DefaultGC(win->display, 0),
219, 0, 219, BUTTON_HEIGHT);
XSetFont(win->display, DefaultGC(win->display, 0), win->large->fid);
XSetForeground(win->display, DefaultGC(win->display, 0),
win->textcolor.pixel);
XSetBackground(win->display, DefaultGC(win->display, 0),
win->textback.pixel);
for (i = 0; i < numbuts; i++) {
x = (buts[i].width -
XTextWidth(win->large, buts[i].label,
strlen(buts[i].label))) / 2;
XDrawImageString(win->display, win->buttonwin,
DefaultGC(win->display, 0),
buts[i].x + x, buts[i].y, buts[i].label,
strlen(buts[i].label));
}
return;
}
void
button_service(win, event)
windata *win;
XEvent *event;
{
XKeyEvent *ev = &event->xkey;
choice c;
int i, numbuts = sizeof (buts) / sizeof (struct but);
char *s;
ev->y += 15;
for (i = 0; i < numbuts; i++)
if ((ev->x >= buts[i].x) && (ev->x <= buts[i].x +
buts[i].width) && (ev->y >= buts[i].y) &&
(ev->y <= buts[i].y + buts[i].height)) {
c = buts[i].which;
break;
}
if ((i == numbuts) || (c == NOCHOICE)) {
message_add(win, "Bad choice.\n", true);
return;
}
if (loading_flag && (c != STOP)) {
message_add(win, "You can only use PAUSE now\n", true);
return;
}
switch (c) {
case DRAW:
if (!oneboard) {
message_add(win, "Just a sec...\n", false);
if (!pop_question(((win == win1) ? win2 : win1),
"The other player wants\nto call the game a draw.\nDo you agree?\n")) {
message_add(win,
"The other player declines the draw\n", false);
return;
}
}
message_add(win1, "Draw agreed.\n", false);
if (!oneboard)
message_add(win2, "Draw agreed.\n", false);
cleanup("Draw agreed.");
break;
case RESIGN:
if (!pop_question(win, "Are you sure\nyou want to resign?"))
return;
if ((oneboard && !progflag) || (nexttomove == win->color)) {
if (nexttomove == WHITE)
s = "White resigns.";
else
s = "Black resigns.";
if (oneboard) {
message_add(win, s, false);
message_add(win, "\n", false);
} else {
message_add(win1, s, false);
message_add(win, "\n", false);
message_add(win2, s, false);
message_add(win, "\n", false);
}
sleep(5);
cleanup(s);
} else {
message_add(win, "It's not your turn.\n", true);
}
break;
case REPLAY:
if (!oneboard) {
message_add(win, "Just a sec...\n", false);
if (!pop_question(((win == win1) ? win2 : win1),
"The other player wants\nto take back his last move.\nDo you let him?\n")) {
message_add(win,
"The other player refuses...\n", false);
return;
}
}
if (!moves) {
message_add(win, "Can't back up...\n", true);
break;
}
message_add(win1, "Replaying...\n", false);
if (!oneboard)
message_add(win2, "Replaying...\n", false);
replay();
if (progflag)
replay();
break;
case FORE:
if (!oneboard) {
message_add(win, "Just a sec...\n", false);
if (!pop_question(((win == win1) ? win2 : win1),
"The other player wants\nto do a 'fore'.\nIs that ok with you?\n")) {
message_add(win,
"The other player refuses...\n", false);
return;
}
}
if (!foremoves) {
message_add(win, "Can't go forward...\n", true);
break;
}
message_add(win1, "Moving forward...\n", false);
if (!oneboard)
message_add(win2, "Moving forward...\n", false);
forward();
break;
case SWITCH:
message_add(win, "You can't switch yet.\n", false);
break;
case SAVE:
if (saveflag) {
message_add(win,
"Game is already being logged in file '", true);
message_add(win, record_file, true);
message_add(win, "'.\n", true);
} else {
message_add(win, "Saving game to file '", false);
message_add(win, record_file, false);
message_add(win, "'.\n", false);
record_save();
}
break;
case STOP:
if (loading_flag) {
loading_paused = (loading_paused ? false : true);
message_add(win, loading_paused ?
"Stopped.\nHit 'Pause' again to restart.\n" :
"Restarted.\n", false);
} else if (clock_started) {
if (!oneboard) {
message_add(win, "Just a sec...\n", false);
if (!pop_question(((win == win1) ? win2 : win1),
"The other player wants\nto stop the clock.\nDo you let him?\n")) {
message_add(win,
"The other player refuses to pause.\n",
false);
return;
}
}
message_add(win1,
"Clock stopped.\nHit 'Pause' again to restart.\n",
false);
if (!oneboard)
message_add(win2,
"Clock stopped.\nHit 'Pause' again to restart.\n",
false);
clock_started = false;
} else {
if (!oneboard) {
message_add(win, "Just a sec...\n", false);
if (!pop_question(((win == win1) ? win2 : win1),
"The other player wants\nto start the clock again.\nIs that ok?\n")) {
message_add(win,
"The other player refuses to resume.\n",
false);
return;
}
}
message_add(win1, "Clock restarted.\n", false);
if (!oneboard)
message_add(win2, "Clock restarted.\n", false);
clock_started = true;
}
break;
case FLIP:
message_add(win, "Flipping window...\n", false);
win->flipped = win->flipped ? false : true;
win_redraw(win, (XEvent *) NULL);
break;
case RESTART:
if (!oneboard) {
message_add(win, "Just a sec...\n", false);
if (!pop_question(((win == win1) ? win2 : win1),
"The other player wants\nto restart the game.\nDo you agree?\n")) {
message_add(win,
"The other player refuses to reset\n", false);
return;
}
}
message_add(win, "Restarting game.\n", false);
restart();
break;
case EASY:
if (oneboard) {
int x;
if (easy)
easy = 0;
else
easy = 1;
if (easy)
buts[EASY_OFFSET].label = " Easy ";
else
buts[EASY_OFFSET].label = "NoEasy";
program_easy(easy);
x = (buts[EASY_OFFSET].width -
XTextWidth(win->large,
buts[EASY_OFFSET].label,
strlen(buts[EASY_OFFSET].label))) / 2;
XSetFont(win->display, DefaultGC(win->display,
0), win->large->fid);
XSetForeground(win->display,
DefaultGC(win->display, 0),
win->textcolor.pixel);
XSetBackground(win->display,
DefaultGC(win->display, 0),
win->textback.pixel);
XDrawImageString(win->display,
win->buttonwin,
DefaultGC(win->display, 0),
buts[EASY_OFFSET].x + x,
buts[EASY_OFFSET].y,
buts[EASY_OFFSET].label,
strlen(buts[EASY_OFFSET].label));
}
break;
}
return;
}

View File

@ -1,292 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
static char rcsid[] = "$Id: clock.c,v 1.2 1993/08/02 17:20:48 mycroft Exp $";
#endif /* not lint */
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*
* Do stuff with the clocks. The way things work is as follows. We call
* clock_init to draw the clocks initially, but they don't actually start
* running until we call clock_switch for the first time.
*/
#include "xchess.h"
int movesperunit = 0;
int timeunit = 0;
bool clock_started = false;
int whiteseconds, blackseconds;
static bool white_running = true;
static long lastwhite, lastblack;
static bool firstmove = true;
extern void dohands(), hilight();
#define PI 3.1415926535897932384
void
clock_draw(win, col)
windata *win;
color col;
{
int i;
char buf[BSIZE];
int x = CLOCK_WIDTH / 2, y = CLOCK_WIDTH / 2;
int xp, yp;
int rad = CLOCK_WIDTH / 2 - 10;
Window w = ((col == WHITE) ? win->wclockwin : win->bclockwin);
/* Draw a clock face and the hands. */
XCircle(w, x, y, rad, 0.0, 0.0, 1, 1, win->textcolor.pixel, GXcopy,
AllPlanes);
rad -= 8;
XSetFont(win->display, DefaultGC(win->display, 0),
win->small->fid);
XSetForeground(win->display, DefaultGC(win->display, 0),
win->textcolor.pixel);
XSetBackground(win->display, DefaultGC(win->display, 0),
win->textback.pixel);
for (i = 1; i <= 12; i++) {
xp = x + rad * cos(PI * 3 / 2 + i * PI / 6) - 4;
yp = y + rad * sin(PI * 3 / 2 + i * PI / 6) - 5;
sprintf(buf, "%d", i);
XDrawString(win->display, w, DefaultGC(win->display, 0),
xp, yp, buf, strlen(buf));
}
dohands(win, col);
if (white_running) {
hilight(win, WHITE, true);
hilight(win, BLACK, false);
} else {
hilight(win, WHITE, false);
hilight(win, BLACK, true);
}
return;
}
void
clock_init(win, col)
windata *win;
color col;
{
whiteseconds = blackseconds = 0;
clock_started = false;
firstmove = true;
clock_draw(win, col);
return;
}
void
clock_update()
{
int now = time((long *) NULL);
int i;
if (!clock_started) {
lastwhite = lastblack = now;
return;
}
if (white_running) {
whiteseconds += now - lastwhite;
lastwhite = now;
dohands(win1, WHITE);
if (!oneboard)
dohands(win2, WHITE);
if (timeunit) {
i = whiteseconds / timeunit;
if ((i > 0) && (whiteseconds > i * timeunit) &&
(whiteseconds < i * timeunit + 10) &&
(movesperunit * i > movenum)) {
message_add(win1,
"White has exceeded his time limit\n",
true);
if (!oneboard) {
message_add(win2,
"White has exceeded his time limit\n",
true);
}
timeunit = 0;
}
}
} else {
blackseconds += now - lastblack;
lastblack = now;
dohands(win1, BLACK);
if (!oneboard)
dohands(win2, BLACK);
if (timeunit) {
i = blackseconds / timeunit;
if ((i > 0) && (blackseconds > i * timeunit) &&
(blackseconds < i * timeunit + 10) &&
(movesperunit * i > movenum)) {
message_add(win1,
"Black has exceeded his time limit\n",
true);
if (!oneboard) {
message_add(win2,
"Black has exceeded his time limit\n",
true);
}
timeunit = 0;
}
}
}
return;
}
void
clock_switch()
{
if (firstmove) {
clock_started = true;
firstmove = false;
lastwhite = lastblack = time((long *) NULL);
}
if (white_running) {
white_running = false;
lastblack = time((long *) NULL);
hilight(win1, WHITE, false);
hilight(win1, BLACK, true);
if (!oneboard) {
hilight(win2, WHITE, false);
hilight(win2, BLACK, true);
}
} else {
white_running = true;
lastwhite = time((long *) NULL);
hilight(win1, WHITE, true);
hilight(win1, BLACK, false);
if (!oneboard) {
hilight(win2, WHITE, true);
hilight(win2, BLACK, false);
}
}
return;
}
static void
dohands(win, col)
windata *win;
color col;
{
int cx = CLOCK_WIDTH / 2, cy = CLOCK_WIDTH / 2;
double *h = (col == WHITE) ? win->whitehands : win->blackhands;
Window w = (col == WHITE) ? win->wclockwin : win->bclockwin;
long secs = (col == WHITE) ? whiteseconds : blackseconds;
int rad, x, y, i;
/* First erase the old hands. */
XSetState(win->display, DefaultGC(win->display, 0),
win->textback.pixel, win->textback.pixel,
GXcopy, AllPlanes);
rad = CLOCK_WIDTH / 2 - 30;
for (i = 0; i < 3; i++) {
x = cx + rad * sin(PI - h[i]);
y = cy + rad * cos(PI - h[i]);
XSetLineAttributes(win->display,
DefaultGC(win->display, 0),
i, LineSolid, 0, 0);
XDrawLine(win->display, w, DefaultGC(win->display, 0),
cx, cy, x, y);
rad -= 8;
}
h[0] = (secs % 60) * 2 * PI / 60;
h[1] = ((secs / 60) % 60) * 2 * PI / 60;
h[2] = ((secs / 3600) % 12) * 2 * PI / 12;
/* Now draw the new ones. */
XSetState(win->display, DefaultGC(win->display, 0),
win->textcolor.pixel, win->textback.pixel,
GXcopy, AllPlanes);
rad = CLOCK_WIDTH / 2 - 30;
for (i = 0; i < 3; i++) {
x = cx + rad * sin(PI - h[i]);
y = cy + rad * cos(PI - h[i]);
XSetLineAttributes(win->display,
DefaultGC(win->display, 0),
i, LineSolid, 0, 0);
XDrawLine(win->display, w, DefaultGC(win->display, 0),
cx, cy, x, y);
rad -= 8;
}
XFlush(win->display);
return;
}
static void
hilight(win, col, on)
windata *win;
color col;
bool on;
{
Window w = (col == WHITE) ? win->wclockwin : win->bclockwin;
char *s = (col == WHITE) ? " WHITE " : " BLACK ";
int x;
x = XTextWidth(win->large, s, strlen(s));
if (on)
XSetState(win->display, DefaultGC(win->display, 0),
win->textback.pixel,
win->textcolor.pixel,
GXcopy,
AllPlanes);
else
XSetState(win->display, DefaultGC(win->display, 0),
win->textcolor.pixel,
win->textback.pixel,
GXcopy, AllPlanes);
XSetLineAttributes(win->display, DefaultGC(win->display, 0),
BORDER_WIDTH, LineSolid, CapButt, JoinMiter);
XSetFont(win->display, DefaultGC(win->display, 0),
win->large->fid);
XDrawLine(win->display, w, DefaultGC(win->display, 0),
0, CLOCK_HEIGHT - 26,
CLOCK_WIDTH, CLOCK_HEIGHT - 26);
XDrawImageString(win->display, w, DefaultGC(win->display, 0),
(CLOCK_WIDTH - x) / 2, CLOCK_HEIGHT,
s, strlen(s));
if (on)
XSetState(win->display, DefaultGC(win->display, 0),
win->textcolor.pixel,
win->textback.pixel,
GXcopy, AllPlanes);
return;
}

View File

@ -1,517 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
static char rcsid[] = "$Id: control.c,v 1.2 1993/08/02 17:20:50 mycroft Exp $";
#endif /* not lint */
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*
* Deal with input from the user.
*/
#include "xchess.h"
move *moves;
move *foremoves;
color nexttomove = WHITE;
bool noisyflag = false;
move *lastmove;
static move *thismove;
static void screen_move();
void
button_pressed(event, win)
XEvent *event;
windata *win;
{
int x, y;
XKeyEvent *ev = (XKeyEvent *) event;
if (!oneboard && (win->color != nexttomove)) {
message_add(win, "Wrong player!\n", true);
return;
}
if (progflag && (nexttomove == (blackflag ? WHITE : BLACK))) {
message_add(win, "Wait for the computer...\n", true);
return;
}
if (loading_flag) {
message_add(win, "You'd better not do that now...\n", true);
return;
}
/* Figure out what piece he is pointing at. */
x = ev->x / (SQUARE_WIDTH + BORDER_WIDTH);
y = ev->y / (SQUARE_HEIGHT + BORDER_WIDTH);
if (win->flipped) {
y = SIZE - y - 1;
x = SIZE - x - 1;
}
if ((x < 0) || (x >= SIZE) || (y < 0) || (y >= SIZE)) {
fprintf(stderr, "Bad coords (%d, %d)\n", x, y);
return;
}
if (oneboard && (chessboard->square[y][x].color != nexttomove)) {
message_add(win, "Wrong player!\n", true);
return;
} else if (!oneboard && (chessboard->square[y][x].color !=
win->color)) {
message_add(win, "Can't move that\n", true);
return;
}
thismove = alloc(move);
thismove->fromx = x;
thismove->fromy = y;
thismove->piece.color = chessboard->square[y][x].color;
thismove->piece.type = chessboard->square[y][x].type;
if (debug)
fprintf(stderr, "%s selected his %s at (%d, %d)...\n",
colornames[(int) thismove->piece.color],
piecenames[(int) thismove->piece.type],
thismove->fromy, thismove->fromx);
return;
}
void
button_released(event, win)
XEvent *event;
windata *win;
{
int x, y;
XKeyEvent *ev = (XKeyEvent *) event;
if (!thismove) {
/* fprintf(stderr, "Error: button hasn't been pressed\n"); */
return;
}
if (loading_flag)
return;
/* Figure out what piece he is pointing at. */
x = ev->x / (SQUARE_WIDTH + BORDER_WIDTH);
y = ev->y / (SQUARE_HEIGHT + BORDER_WIDTH);
if (win->flipped) {
y = SIZE - y - 1;
x = SIZE - x - 1;
}
if ((x < 0) || (x >= SIZE) || (y < 0) || (y >= SIZE)) {
fprintf(stderr, "Bad coords (%d, %d)\n", x, y);
return;
}
if ((thismove->fromx == x) && (thismove->fromy == y)) {
message_add(win, "Hey, you touch it, you move it, buddy.\n",
true);
return;
}
if (chessboard->square[y][x].color == thismove->piece.color) {
message_add(win, "Can't put one piece on top of another\n",
true);
return;
}
thismove->tox = x;
thismove->toy = y;
thismove->taken.color = chessboard->square[y][x].color;
thismove->taken.type = chessboard->square[y][x].type;
if (thismove->taken.color != NONE)
thismove->type = CAPTURE;
else if ((thismove->piece.type == KING) && (thismove->fromx == 4) &&
(thismove->tox == 6) &&
(thismove->toy == thismove->fromy))
thismove->type = KCASTLE;
else if ((thismove->piece.type == KING) && (thismove->tox == 2) &&
(thismove->fromx == 4) &&
(thismove->toy == thismove->fromy))
thismove->type = QCASTLE;
else
thismove->type = MOVE;
/* Now check the en-passant case... */
if ((thismove->type == MOVE) && ((thismove->tox == thismove->fromx + 1)
|| (thismove->tox == thismove->fromx - 1)) &&
(thismove->piece.type == PAWN) && lastmove &&
(lastmove->tox == lastmove->fromx) && (lastmove->fromx
== thismove->tox) && ((lastmove->fromy + lastmove->toy)
/ 2 == thismove->toy)) {
thismove->type = CAPTURE;
thismove->enpassant = true;
thismove->taken = lastmove->piece;
}
if (!valid_move(thismove, chessboard)) {
message_add(win, "Invalid move.\n", true);
return;
}
if (debug)
fprintf(stderr, "\t... and moved it to (%d, %d), type %s\n",
thismove->toy, thismove->tox,
movetypenames[(int) thismove->type]);
move_piece(thismove);
if (thismove->check) {
message_add(win1, "Check.\n", true);
if (!oneboard) {
message_add(win2, "Check.\n", true);
}
}
if (!moves)
moves = lastmove = thismove;
else
lastmove = lastmove->next = thismove;
if (progflag)
program_send(thismove);
thismove = NULL;
nexttomove = ((nexttomove == WHITE) ? BLACK : WHITE);
clock_switch();
return;
}
void
prog_move(m)
move *m;
{
if (debug)
fprintf(stderr, "program moves from (%d, %d) to (%d, %d)\n",
m->fromy, m->fromx, m->toy, m->tox);
move_piece(m);
if (!moves)
moves = lastmove = m;
else
lastmove = lastmove->next = m;
nexttomove = ((nexttomove == WHITE) ? BLACK : WHITE);
clock_switch();
return;
}
void
move_piece(m)
move *m;
{
/* Update the screen... */
screen_move(m);
/* Move the piece on the board... */
board_move(chessboard, m);
/* And record it... */
record_move(m);
if (noisyflag) {
XBell(win1->display, 50);
XBell(win2->display, 50);
}
return;
}
static void
screen_move(m)
move *m;
{
piece pp;
switch (m->type) {
case CAPTURE:
jail_add(&m->taken);
/* FALLTHRU */
case MOVE:
win_erasepiece(m->fromy, m->fromx, WHITE);
if (win_flashmove)
win_flash(m, WHITE);
win_drawpiece(&m->piece, m->toy, m->tox, WHITE);
if (m->enpassant)
win_erasepiece(m->toy + ((m->piece.color == WHITE) ?
1 : -1), m->tox, WHITE);
if (!oneboard) {
win_erasepiece(m->fromy, m->fromx, BLACK);
if (win_flashmove)
win_flash(m, BLACK);
win_drawpiece(&m->piece, m->toy, m->tox, BLACK);
if (m->enpassant)
win_erasepiece(m->toy + ((m->piece.color ==
WHITE) ? 1 : -1), m->tox, WHITE);
}
if ((m->piece.type == PAWN) && (((m->piece.color == BLACK) &&
(m->toy == 7)) || ((m->piece.color == WHITE) &&
(m->toy == 0)))) {
pp.color = m->piece.color;
pp.type = QUEEN;
win_drawpiece(&pp, m->toy, m->tox, WHITE);
if (!oneboard)
win_drawpiece(&m->piece, m->toy, m->tox, BLACK);
}
break;
case KCASTLE:
if (m->piece.color == WHITE) {
win_erasepiece(7, 4, WHITE);
win_erasepiece(7, 7, WHITE);
if (win_flashmove)
win_flash(m, WHITE);
win_drawpiece(&m->piece, 7, 6, WHITE);
win_drawpiece(&chessboard->square[7][7], 7, 5, WHITE);
if (!oneboard) {
win_erasepiece(7, 4, BLACK);
win_erasepiece(7, 7, BLACK);
if (win_flashmove)
win_flash(m, BLACK);
win_drawpiece(&m->piece, 7, 6, BLACK);
win_drawpiece(&chessboard->square[7][7], 7, 5,
BLACK);
}
} else {
win_erasepiece(0, 4, WHITE);
win_erasepiece(0, 7, WHITE);
if (win_flashmove)
win_flash(m, WHITE);
win_drawpiece(&m->piece, 0, 6, WHITE);
win_drawpiece(&chessboard->square[0][7], 0, 5, WHITE);
if (!oneboard) {
win_erasepiece(0, 4, BLACK);
win_erasepiece(0, 7, BLACK);
if (win_flashmove)
win_flash(m, BLACK);
win_drawpiece(&m->piece, 0, 6, BLACK);
win_drawpiece(&chessboard->square[0][7], 0, 5,
BLACK);
}
}
break;
case QCASTLE:
if (m->piece.color == WHITE) {
win_erasepiece(7, 4, WHITE);
win_erasepiece(7, 0, WHITE);
if (win_flashmove)
win_flash(m, WHITE);
win_drawpiece(&m->piece, 7, 2, WHITE);
win_drawpiece(&chessboard->square[7][0], 7, 3, WHITE);
if (!oneboard) {
win_erasepiece(7, 4, BLACK);
win_erasepiece(7, 0, BLACK);
if (win_flashmove)
win_flash(m, BLACK);
win_drawpiece(&m->piece, 7, 2, BLACK);
win_drawpiece(&chessboard->square[7][7], 7, 3,
BLACK);
}
} else {
win_erasepiece(0, 4, WHITE);
win_erasepiece(0, 0, WHITE);
if (win_flashmove)
win_flash(m, WHITE);
win_drawpiece(&m->piece, 0, 2, WHITE);
win_drawpiece(&chessboard->square[0][0], 0, 3, WHITE);
if (!oneboard) {
win_erasepiece(0, 4, BLACK);
win_erasepiece(0, 0, BLACK);
if (win_flashmove)
win_flash(m, BLACK);
win_drawpiece(&m->piece, 0, 2, BLACK);
win_drawpiece(&chessboard->square[0][7], 0, 3,
BLACK);
}
}
break;
default:
fprintf(stderr, "Bad move type %d\n", m->type);
}
return;
}
/* Retract the last move made... */
void
replay()
{
move *m = lastmove, bm;
memset(&bm, 0, sizeof(bm));
switch (m->type) {
case MOVE:
bm.type = MOVE;
bm.piece = m->piece;
bm.fromx = m->tox;
bm.fromy = m->toy;
bm.tox = m->fromx;
bm.toy = m->fromy;
board_move(chessboard, &bm);
screen_move(&bm);
break;
case CAPTURE:
bm.type = MOVE;
bm.piece = m->piece;
bm.fromx = m->tox;
bm.fromy = m->toy;
bm.tox = m->fromx;
bm.toy = m->fromy;
board_move(chessboard, &bm);
screen_move(&bm);
chessboard->square[m->toy][m->tox] = m->taken;
bm.piece = m->taken;
bm.fromx = bm.tox = m->tox;
bm.fromy = bm.toy = m->toy;
screen_move(&bm);
jail_remove(&m->taken);
break;
case KCASTLE:
bm.type = MOVE;
bm.piece.type = KING;
bm.piece.color = m->piece.color;
bm.fromx = 6;
bm.tox = 4;
bm.fromy = bm.toy = (m->piece.color == WHITE) ? 7 : 0;
board_move(chessboard, &bm);
screen_move(&bm);
bm.type = MOVE;
bm.piece.type = ROOK;
bm.piece.color = m->piece.color;
bm.fromx = 5;
bm.tox = 7;
bm.fromy = bm.toy = (m->piece.color == WHITE) ? 7 : 0;
board_move(chessboard, &bm);
screen_move(&bm);
if (m->piece.color == WHITE)
chessboard->white_cant_castle_k = false;
else
chessboard->black_cant_castle_k = false;
break;
case QCASTLE:
bm.type = MOVE;
bm.piece.type = KING;
bm.piece.color = m->piece.color;
bm.fromx = 2;
bm.tox = 4;
bm.fromy = bm.toy = (m->piece.color == WHITE) ? 7 : 0;
board_move(chessboard, &bm);
screen_move(&bm);
bm.type = MOVE;
bm.piece.type = ROOK;
bm.piece.color = m->piece.color;
bm.fromx = 3;
bm.tox = 0;
bm.fromy = bm.toy = (m->piece.color == WHITE) ? 7 : 0;
board_move(chessboard, &bm);
screen_move(&bm);
if (m->piece.color == WHITE)
chessboard->white_cant_castle_q = false;
else
chessboard->black_cant_castle_q = false;
break;
}
record_back();
nexttomove = ((nexttomove == WHITE) ? BLACK : WHITE);
clock_switch();
if (!moves->next) {
moves->next = foremoves;
foremoves = moves;
moves = lastmove = NULL;
} else {
for (m = moves; m->next; m = m->next)
lastmove = m;
lastmove->next->next = foremoves;
foremoves = lastmove->next;
lastmove->next = NULL;
}
if (progflag)
program_undo();
return;
}
/* Put back the last move undone. */
void
forward()
{
prog_move(foremoves);
foremoves = foremoves->next;
return;
}
/* End the game. */
void
cleanup(s)
char *s;
{
if (progflag)
program_end();
record_end(s);
XSync(win1->display, 0);
if (!oneboard) {
XSync(win2->display, 0);
}
exit(0);
}
void
restart()
{
moves = lastmove = thismove = NULL;
nexttomove = WHITE;
clock_init(win1, WHITE);
clock_init(win1, BLACK);
jail_init(win1);
if (!oneboard) {
clock_init(win2, WHITE);
clock_init(win2, BLACK);
jail_init(win2);
}
board_init(chessboard);
win_restart();
record_reset();
if (progflag) {
program_end();
program_init(progname);
}
return;
}

View File

@ -1,328 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
static char rcsid[] = "$Id: jail.c,v 1.2 1993/08/02 17:20:51 mycroft Exp $";
#endif /* not lint */
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*
*/
#include "xchess.h"
#include "pawn_small.bitmap"
#include "rook_small.bitmap"
#include "knight_small.bitmap"
#include "bishop_small.bitmap"
#include "queen_small.bitmap"
#include "king_small.bitmap"
#include "pawn_small_outline.bitmap"
#include "rook_small_outline.bitmap"
#include "knight_small_outline.bitmap"
#include "bishop_small_outline.bitmap"
#include "queen_small_outline.bitmap"
#include "king_small_outline.bitmap"
static bool pos[32];
static piecetype pcs[] = { KING, QUEEN, ROOK, ROOK, BISHOP, BISHOP, KNIGHT,
KNIGHT, PAWN, PAWN, PAWN, PAWN, PAWN, PAWN, PAWN, PAWN } ;
extern int piecepos();
extern char *bitsget();
void
jail_init(win)
windata *win;
{
int i;
for (i = 0; i < 32; i++)
pos[i] = false;
jail_draw(win);
return;
}
#define JAIL_HEADER "Captured Pieces"
void
jail_draw(win)
windata *win;
{
int i;
char *bits;
Pixmap tmpPM;
piece p;
i = XTextWidth(win->large, JAIL_HEADER, strlen(JAIL_HEADER));
XSetFont(win->display, DefaultGC(win->display, 0),
win->large->fid);
XSetForeground(win->display, DefaultGC(win->display, 0),
win->textcolor.pixel);
XSetBackground(win->display, DefaultGC(win->display, 0),
win->textback.pixel);
XDrawImageString(win->display, win->jailwin,
DefaultGC(win->display, 0),
(JAIL_WIDTH - i) / 2, 20, JAIL_HEADER,
strlen(JAIL_HEADER));
XSetForeground(win->display, DefaultGC(win->display, 0),
win->blackpiece.pixel);
XSetBackground(win->display, DefaultGC(win->display, 0),
win->textback.pixel);
XSetFillStyle(win->display, DefaultGC(win->display, 0),
FillSolid);
XSetFunction(win->display, DefaultGC(win->display, 0),
GXcopy);
for (i = 0; i < 16; i++)
if (pos[i]) {
p.color = WHITE;
p.type = pcs[i];
bits = bitsget(&p);
tmpPM = XCreateBitmapFromData(win->display,
win->jailwin, bits,
32, 32);
XCopyPlane(win->display, tmpPM, win->jailwin,
DefaultGC(win->display, 0),
0, 0, 32, 32,
5 + (i % 8) * 32, 25 + (i / 8) * 32,
1);
XFreePixmap(win->display, tmpPM);
} else {
XFillRectangle(win->display, win->jailwin,
DefaultGC(win->display, 0),
5 + (i % 8) * 32,
25 + (i / 8) * 32,
32, 32);
}
for (i = 0; i < 16; i++)
if (pos[i + 16]) {
p.color = BLACK;
p.type = pcs[i];
bits = bitsget(&p);
tmpPM = XCreateBitmapFromData(win->display,
win->jailwin, bits,
32, 32);
XCopyPlane(win->display, tmpPM, win->jailwin,
DefaultGC(win->display, 0),
0, 0, 32, 32,
5 + (i % 8) * 32, 94 + (i / 8) * 32,
1);
XFreePixmap(win->display, tmpPM);
} else {
XFillRectangle(win->display, win->jailwin,
DefaultGC(win->display, 0),
5 + (i % 8) * 32, 94 + (i / 8) * 32,
32, 32);
}
return;
}
void
jail_add(p)
piece *p;
{
int i = piecepos(p, false);
char *bits;
Pixmap tmpPM;
pos[i] = true;
bits = bitsget(p);
XSetState(win1->display, DefaultGC(win1->display, 0),
win1->blackpiece.pixel,
win1->textback.pixel,
GXcopy,
AllPlanes);
tmpPM = XCreateBitmapFromData(win1->display,
win1->jailwin, bits,
32, 32);
XCopyPlane(win1->display, tmpPM, win1->jailwin,
DefaultGC(win1->display, 0),
0, 0, 32, 32,
5 + (i % 8) * 32, ((i >= 16) ? 30 : 25) + (i / 8) * 32,
1);
XFreePixmap(win1->display, tmpPM);
if (!oneboard) {
XSetState(win2->display, DefaultGC(win2->display, 0),
win2->blackpiece.pixel,
win2->textback.pixel,
GXcopy,
AllPlanes);
tmpPM = XCreateBitmapFromData(win2->display,
win2->jailwin, bits,
32, 32);
XCopyPlane(win2->display, tmpPM, win2->jailwin,
DefaultGC(win2->display, 0),
0, 0, 32, 32,
5 + (i % 8) * 32, ((i >= 16) ? 30 : 25) + (i / 8) * 32,
1);
XFreePixmap(win2->display, tmpPM);
}
return;
}
void
jail_remove(p)
piece *p;
{
int i = piecepos(p, true);
pos[i] = false;
XSetForeground(win1->display,
DefaultGC(win1->display, 0),
win1->blackpiece.pixel);
XSetBackground(win1->display,
DefaultGC(win1->display, 0),
win1->textback.pixel);
XSetFillStyle(win1->display,
DefaultGC(win1->display, 0),
FillSolid);
XFillRectangle(win1->display, win1->jailwin,
DefaultGC(win1->display, 0),
5 + (i % 8) * 32,
((i >= 16) ? 30 : 25) + (i / 8) * 32,
32, 32);
if (!oneboard) {
XSetForeground(win2->display,
DefaultGC(win2->display, 0),
win2->blackpiece.pixel);
XSetBackground(win2->display,
DefaultGC(win2->display, 0),
win2->textback.pixel);
XSetFillStyle(win2->display,
DefaultGC(win2->display, 0),
FillSolid);
XFillRectangle(win2->display, win2->jailwin,
DefaultGC(win2->display, 0),
5 + (i % 8) * 32,
((i >= 16) ? 30 : 25) + (i / 8) * 32,
32, 32);
}
return;
}
static char *bitsget(p)
piece *p;
{
char *bits;
switch (p->type) {
case PAWN:
bits = (p->color == WHITE) ? pawn_small_outline_bits :
pawn_small_bits;
break;
case ROOK:
bits = (p->color == WHITE) ? rook_small_outline_bits :
rook_small_bits;
break;
case KNIGHT:
bits = (p->color == WHITE) ? knight_small_outline_bits :
knight_small_bits;
break;
case BISHOP:
bits = (p->color == WHITE) ? bishop_small_outline_bits :
bishop_small_bits;
break;
case QUEEN:
bits = (p->color == WHITE) ? queen_small_outline_bits :
queen_small_bits;
break;
case KING:
bits = (p->color == WHITE) ? king_small_outline_bits :
king_small_bits;
break;
}
return (bits);
}
static int
piecepos(p, there)
piece *p;
bool there;
{
int i, base = (p->color == WHITE) ? 0 : 16;
switch (p->type) {
case PAWN:
for (i = base + 8; (i < base + 15) && pos[i]; i++)
;
if (there && !pos[i])
i--;
break;
case KING:
/* Hmm... */
i = base;
break;
case QUEEN:
i = base + 1;
break;
case ROOK:
i = base + 2;
if ((there && pos[i + 1]) || (!there && pos[i]))
i++;
break;
case BISHOP:
i = base + 4;
if ((there && pos[i + 1]) || (!there && pos[i]))
i++;
break;
case KNIGHT:
i = base + 6;
if ((there && pos[i + 1]) || (!there && pos[i]))
i++;
break;
}
return (i);
}

View File

@ -1,71 +0,0 @@
#define king_width 80
#define king_height 80
static char king_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x30, 0x18, 0x00, 0xfc, 0x1f, 0x00,
0x00, 0xfe, 0x7f, 0x00, 0xb8, 0x3b, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff,
0xff, 0x00, 0xb8, 0x3b, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x03,
0xb8, 0x3b, 0xe0, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0x0f, 0xb8, 0x3b,
0xf0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x1f, 0xb8, 0x3b, 0xf8, 0xff,
0xf8, 0x07, 0xe0, 0x1f, 0xc0, 0x3f, 0xb8, 0x3b, 0xfc, 0x07, 0xe2, 0x07,
0xf0, 0xcf, 0x9f, 0x7f, 0x30, 0x18, 0xfe, 0xf3, 0xcf, 0x0f, 0xf0, 0xe7,
0x3f, 0xfe, 0xf0, 0x1f, 0x7e, 0xfc, 0xdf, 0x0f, 0xf0, 0xf3, 0xff, 0xfc,
0xf1, 0x1f, 0x3f, 0xff, 0x9f, 0x0f, 0xf8, 0xfb, 0xff, 0xfd, 0xf3, 0x9f,
0xbf, 0xff, 0xbf, 0x1f, 0xf8, 0xf9, 0xff, 0xf9, 0xe3, 0x8f, 0xdf, 0xff,
0x3f, 0x1f, 0xf8, 0xfd, 0xff, 0xf3, 0xef, 0xcf, 0xcf, 0xff, 0x7f, 0x1f,
0xf8, 0xfd, 0xff, 0xe7, 0xef, 0xef, 0xef, 0xff, 0x7f, 0x1f, 0xfc, 0xfd,
0xff, 0xcf, 0xff, 0xff, 0xe7, 0x3f, 0x7c, 0x3f, 0xfc, 0x3c, 0xfc, 0xdf,
0xff, 0xfe, 0xf3, 0x3d, 0x7c, 0x3f, 0xfc, 0x3e, 0xfc, 0x9e, 0x7f, 0xfc,
0xf9, 0x39, 0x7c, 0x3f, 0xfc, 0x3e, 0x7c, 0xbe, 0x3f, 0xf8, 0xf9, 0x3b,
0x7c, 0x3f, 0xfc, 0x3e, 0x78, 0x3f, 0x7f, 0xfc, 0xfc, 0x3b, 0x7f, 0x3f,
0xfc, 0xfe, 0x7b, 0x7f, 0xff, 0xfe, 0xfe, 0x9b, 0x7f, 0x3f, 0xf8, 0xfe,
0xbb, 0x7f, 0xfe, 0x7f, 0xfe, 0xdb, 0x79, 0x1f, 0xf8, 0xfe, 0xb3, 0xff,
0xfe, 0x7f, 0xff, 0xcb, 0x7c, 0x1f, 0xf8, 0x9e, 0xb7, 0xff, 0xfe, 0x7f,
0xff, 0x2b, 0x3e, 0x1f, 0xf8, 0x3e, 0xa6, 0xff, 0xfc, 0x7f, 0xff, 0xa3,
0xbf, 0x1f, 0xf8, 0xfe, 0xa8, 0xff, 0xfd, 0x3e, 0xff, 0xd3, 0xbf, 0x1f,
0xf8, 0xfd, 0x83, 0xff, 0x7d, 0xbc, 0xff, 0xc3, 0xbf, 0x1f, 0xf0, 0xfd,
0x8f, 0xff, 0x39, 0xb8, 0xff, 0xe3, 0xbf, 0x1f, 0xf0, 0xfd, 0x9f, 0xff,
0x7b, 0xbc, 0xff, 0xf1, 0x9f, 0x0f, 0xf0, 0xf9, 0xbf, 0xff, 0xfb, 0xbe,
0xff, 0xfd, 0xdf, 0x0f, 0xf0, 0xfb, 0x3f, 0xff, 0xf3, 0x9f, 0xff, 0xfd,
0xdf, 0x0f, 0xf0, 0xf3, 0x7f, 0xff, 0xf7, 0xdf, 0xff, 0xfc, 0xdf, 0x0f,
0xe0, 0xf7, 0x7f, 0xfe, 0xf7, 0xdf, 0xff, 0xfe, 0xdf, 0x07, 0xe0, 0xf7,
0xff, 0xfe, 0xf7, 0xdf, 0x7f, 0xfe, 0xcf, 0x07, 0xe0, 0xe7, 0xff, 0xfe,
0xf7, 0xdf, 0x7f, 0xff, 0xef, 0x07, 0xc0, 0xef, 0xff, 0xfc, 0xef, 0xee,
0x7f, 0xff, 0xe7, 0x03, 0xc0, 0xcf, 0xff, 0xfd, 0x6f, 0xec, 0x3f, 0xff,
0xf7, 0x03, 0x80, 0xdf, 0xff, 0xf9, 0xef, 0xee, 0xbf, 0xff, 0xf3, 0x01,
0x80, 0x9f, 0xff, 0xfb, 0xef, 0xef, 0x9f, 0xff, 0xfb, 0x01, 0x00, 0xbf,
0xff, 0xfb, 0xef, 0xef, 0xdf, 0xff, 0xf9, 0x00, 0x00, 0x7e, 0xff, 0xf3,
0xef, 0xef, 0xdf, 0xff, 0x7e, 0x00, 0x00, 0x7e, 0xfe, 0xff, 0xef, 0xef,
0xff, 0x7f, 0x7e, 0x00, 0x00, 0xfc, 0xfc, 0xff, 0xef, 0xef, 0xff, 0x7f,
0x3f, 0x00, 0x00, 0xfc, 0xf9, 0xff, 0xef, 0xef, 0xff, 0x3f, 0x1f, 0x00,
0x00, 0xf8, 0xfb, 0x03, 0xe0, 0x0f, 0x00, 0x9f, 0x1f, 0x00, 0x00, 0xf0,
0x03, 0xf8, 0xff, 0xff, 0x7f, 0xc0, 0x0f, 0x00, 0x00, 0xe0, 0xff, 0xbf,
0xf7, 0xde, 0xfb, 0xff, 0x07, 0x00, 0x00, 0xc0, 0xff, 0x1d, 0x63, 0x8c,
0x71, 0xff, 0x03, 0x00, 0x00, 0x80, 0xef, 0xb8, 0xf7, 0xde, 0x3b, 0xee,
0x01, 0x00, 0x00, 0x00, 0xc7, 0xfd, 0xff, 0xff, 0x7f, 0xc7, 0x00, 0x00,
0x00, 0x00, 0xee, 0xff, 0x00, 0x00, 0xfc, 0x6f, 0x00, 0x00, 0x00, 0x00,
0xfe, 0x03, 0xfe, 0xff, 0x01, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x06, 0xf8,
0x7f, 0xfc, 0x7f, 0x60, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x1f, 0xf0,
0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xff, 0x07, 0xc0, 0xff, 0x63,
0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0x1f, 0xf0, 0xff, 0x60, 0x00, 0x00,
0x00, 0x00, 0x06, 0xfc, 0x7f, 0xfc, 0x3f, 0x60, 0x00, 0x00, 0x00, 0x00,
0x06, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xff,
0x00, 0x00, 0xfc, 0x63, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x03, 0xfe, 0xff,
0x01, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x06, 0xf8, 0xff, 0xff, 0x7f, 0x60,
0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00,
0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,71 +0,0 @@
#define king_mask_width 80
#define king_mask_height 80
static char king_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x3f,
0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0xf8, 0x3f, 0x00, 0xfe,
0x3f, 0x00, 0x00, 0xff, 0xff, 0x00, 0xfc, 0x3f, 0x80, 0xff, 0x7f, 0x00,
0x80, 0xff, 0xff, 0x01, 0xfc, 0x7f, 0xc0, 0xff, 0xff, 0x00, 0xc0, 0xff,
0xff, 0x07, 0xfc, 0x7f, 0xe0, 0xff, 0xff, 0x01, 0xe0, 0xff, 0xff, 0x1f,
0xfc, 0x7f, 0xf8, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x3f, 0xfc, 0x7f,
0xfc, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x7f, 0xfc, 0x7f, 0xfe, 0xff,
0xff, 0x0f, 0xf8, 0xff, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xff, 0x1f,
0xf8, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf8, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x1f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf0, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x07, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07,
0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xc0, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x80, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x7f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xfc,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xf8, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x07, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x03, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,71 +0,0 @@
#define king_outline_width 80
#define king_outline_height 80
static char king_outline_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x40, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x1c,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x70, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x40, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x3c,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x0c, 0x60, 0x00, 0xfc, 0x1f, 0x00,
0x00, 0x0e, 0x70, 0x00, 0x84, 0x43, 0x00, 0x07, 0x70, 0x00, 0x00, 0x03,
0xc0, 0x00, 0xc4, 0x46, 0x80, 0x01, 0xc0, 0x00, 0x80, 0x01, 0x80, 0x03,
0x44, 0x44, 0xe0, 0x00, 0x80, 0x01, 0xc0, 0x00, 0x00, 0x0e, 0x44, 0x44,
0x30, 0x00, 0x00, 0x03, 0x60, 0x00, 0x00, 0x18, 0x44, 0x44, 0x18, 0x00,
0x07, 0x06, 0x20, 0xe0, 0x3f, 0x30, 0xc4, 0x46, 0x0c, 0xf8, 0x1d, 0x04,
0x30, 0x30, 0x60, 0x60, 0x8c, 0x63, 0x06, 0x0c, 0x30, 0x0c, 0x10, 0x18,
0xc0, 0xc1, 0x08, 0x20, 0x82, 0x03, 0x20, 0x0c, 0x10, 0x0c, 0x00, 0x83,
0x09, 0x20, 0xc3, 0x00, 0x60, 0x08, 0x18, 0x04, 0x00, 0x02, 0x8b, 0xa3,
0x41, 0x00, 0x40, 0x18, 0x08, 0x06, 0x00, 0x06, 0x7a, 0xb6, 0x20, 0x00,
0xc0, 0x10, 0x08, 0x02, 0x00, 0x0c, 0x3e, 0x7c, 0x30, 0x00, 0x80, 0x10,
0x08, 0x02, 0x00, 0x18, 0x18, 0x18, 0x10, 0x00, 0x80, 0x10, 0x0c, 0x02,
0x00, 0x30, 0x00, 0x00, 0x18, 0xc0, 0x83, 0x30, 0x04, 0xc3, 0x03, 0x20,
0x00, 0x01, 0x0c, 0xc2, 0x83, 0x20, 0x04, 0xc1, 0x03, 0x61, 0x80, 0x03,
0x06, 0xc6, 0x83, 0x20, 0x04, 0xc1, 0x83, 0x41, 0xc0, 0x07, 0x06, 0xc4,
0x83, 0x20, 0x04, 0xc1, 0x87, 0xc0, 0x80, 0x03, 0x03, 0xc4, 0x80, 0x20,
0x0c, 0x01, 0x84, 0x80, 0x00, 0x01, 0x01, 0x64, 0x80, 0x30, 0x08, 0x01,
0x44, 0x80, 0x01, 0x80, 0x01, 0x24, 0x86, 0x10, 0x08, 0x01, 0x4c, 0x00,
0x01, 0x80, 0x00, 0x34, 0x83, 0x10, 0x08, 0x61, 0x48, 0x00, 0x01, 0x80,
0x00, 0xd4, 0xc1, 0x10, 0x08, 0xc1, 0x59, 0x00, 0x03, 0x80, 0x00, 0x5c,
0x40, 0x10, 0x08, 0x01, 0x57, 0x00, 0x02, 0xc1, 0x00, 0x2c, 0x40, 0x10,
0x18, 0x02, 0x7c, 0x00, 0x82, 0x43, 0x00, 0x3c, 0x40, 0x18, 0x10, 0x02,
0x70, 0x00, 0xc6, 0x47, 0x00, 0x1c, 0x40, 0x18, 0x10, 0x02, 0x60, 0x00,
0x84, 0x43, 0x00, 0x0e, 0x60, 0x08, 0x10, 0x06, 0x40, 0x00, 0x04, 0x41,
0x00, 0x02, 0x20, 0x08, 0x10, 0x04, 0xc0, 0x00, 0x0c, 0x60, 0x00, 0x02,
0x20, 0x0c, 0x30, 0x0c, 0x80, 0x00, 0x08, 0x20, 0x00, 0x03, 0x20, 0x0c,
0x20, 0x08, 0x80, 0x01, 0x08, 0x20, 0x00, 0x01, 0x20, 0x04, 0x20, 0x08,
0x00, 0x01, 0x08, 0x20, 0x80, 0x01, 0x30, 0x04, 0x60, 0x18, 0x00, 0x01,
0x08, 0x20, 0x80, 0x00, 0x10, 0x06, 0x40, 0x10, 0x00, 0x03, 0x10, 0x11,
0x80, 0x00, 0x18, 0x02, 0xc0, 0x30, 0x00, 0x02, 0x90, 0x13, 0xc0, 0x00,
0x08, 0x03, 0x80, 0x20, 0x00, 0x06, 0x10, 0x11, 0x40, 0x00, 0x04, 0x01,
0x80, 0x61, 0x00, 0x04, 0x10, 0x10, 0x60, 0x00, 0x84, 0x01, 0x00, 0x41,
0x00, 0x04, 0x10, 0x10, 0x20, 0x00, 0xc6, 0x00, 0x00, 0x83, 0x00, 0x0c,
0x10, 0x10, 0x20, 0x00, 0x41, 0x00, 0x00, 0x82, 0x01, 0x00, 0x10, 0x10,
0x00, 0x80, 0x61, 0x00, 0x00, 0x06, 0x01, 0x00, 0x10, 0x10, 0x00, 0x80,
0x30, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x10, 0x10, 0x00, 0xc0, 0x10, 0x00,
0x00, 0x18, 0x02, 0xff, 0x1f, 0xf0, 0xff, 0x60, 0x18, 0x00, 0x00, 0x30,
0xfe, 0x01, 0x00, 0x00, 0x80, 0x3f, 0x0c, 0x00, 0x00, 0x20, 0x00, 0x40,
0x08, 0x21, 0x04, 0x00, 0x06, 0x00, 0x00, 0xc0, 0x00, 0xe2, 0x9c, 0x73,
0x8e, 0x00, 0x03, 0x00, 0x00, 0x80, 0x11, 0x47, 0x08, 0x21, 0xc4, 0x11,
0x01, 0x00, 0x00, 0x00, 0x3b, 0x02, 0x00, 0x00, 0x80, 0xb8, 0x00, 0x00,
0x00, 0x00, 0x12, 0x00, 0xff, 0xff, 0x03, 0x90, 0x00, 0x00, 0x00, 0x00,
0x02, 0xfc, 0x01, 0x00, 0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x07,
0x80, 0x03, 0x80, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xe0, 0x0f,
0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0xf8, 0x3f, 0x00, 0x5c,
0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0xe0, 0x0f, 0x00, 0x5f, 0x00, 0x00,
0x00, 0x00, 0xfa, 0x03, 0x80, 0x03, 0xc0, 0x5f, 0x00, 0x00, 0x00, 0x00,
0xfa, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00,
0xff, 0xff, 0x03, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02, 0xfc, 0x01, 0x00,
0xfe, 0x40, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x07, 0x00, 0x00, 0x80, 0x5f,
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,15 +0,0 @@
#define king_small_width 32
#define king_small_height 32
static char king_small_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xe0, 0x00, 0x00, 0x80, 0x9f, 0x00, 0x00, 0x70, 0x20, 0x00,
0x00, 0x0c, 0x40, 0x00, 0x00, 0x02, 0x80, 0x01, 0x80, 0x01, 0x00, 0x03,
0x40, 0x00, 0x00, 0x06, 0x40, 0x60, 0x30, 0x08, 0x20, 0x60, 0x30, 0x10,
0x20, 0x00, 0x00, 0x60, 0x20, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x80,
0x10, 0x00, 0x02, 0x80, 0x10, 0x00, 0x01, 0x80, 0x10, 0x01, 0x01, 0x80,
0x10, 0x03, 0x1f, 0x84, 0x10, 0x02, 0x00, 0x84, 0x10, 0x06, 0x00, 0x86,
0x20, 0x1c, 0x00, 0x42, 0x20, 0xf0, 0xff, 0x43, 0x20, 0x00, 0x00, 0x40,
0x40, 0x00, 0x00, 0x20, 0x40, 0x00, 0x00, 0x20, 0x80, 0x01, 0x00, 0x18,
0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,15 +0,0 @@
#define king_small_outline_width 32
#define king_small_outline_height 32
static char king_small_outline_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x90, 0x00, 0x06, 0x10, 0xb1, 0x00,
0x22, 0x12, 0xe1, 0x00, 0x24, 0x92, 0x9f, 0x00, 0x40, 0x72, 0xa0, 0x50,
0x04, 0x0e, 0x40, 0x50, 0x40, 0x02, 0x80, 0x71, 0xc8, 0x01, 0x00, 0x73,
0xd8, 0x00, 0x00, 0x46, 0xd8, 0x60, 0x30, 0x08, 0xa0, 0x60, 0x30, 0x10,
0x20, 0x00, 0x00, 0x60, 0x20, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x80,
0x10, 0x00, 0x02, 0x80, 0x10, 0x00, 0x01, 0x80, 0x10, 0x01, 0x01, 0x80,
0x10, 0x03, 0x1f, 0x84, 0x10, 0x02, 0x00, 0x84, 0x10, 0x06, 0x00, 0x86,
0x20, 0x1c, 0x00, 0x42, 0x20, 0xf0, 0xff, 0x43, 0x20, 0x00, 0x00, 0x40,
0x40, 0x00, 0x00, 0x20, 0x40, 0x00, 0x00, 0x20, 0x80, 0x01, 0x00, 0x18,
0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,71 +0,0 @@
#define knight_width 80
#define knight_height 80
static char knight_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x18, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x38, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xbf, 0xff,
0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0xfe, 0x0f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xf8, 0xff, 0x01, 0x00, 0x00,
0x00, 0x00, 0xe0, 0x0f, 0xfc, 0xe3, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xe1, 0xf3, 0xcf, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfd,
0xff, 0x1f, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0xfe, 0x7f,
0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0xfe, 0xff, 0xfc, 0x07,
0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xf1, 0x7f, 0x00, 0x00,
0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xe7, 0x1f, 0x00, 0x00, 0x00, 0xe0,
0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0x03, 0x00, 0x00, 0xf0, 0xff, 0xff,
0xff, 0xff, 0x9f, 0x3f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff,
0x3f, 0xff, 0x07, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe,
0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0x07, 0x00,
0x00, 0xfe, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xfd, 0x01, 0x00, 0x00, 0xff,
0xff, 0xff, 0xff, 0x3f, 0xff, 0xfb, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff,
0xff, 0xbf, 0xff, 0xf3, 0x03, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x9f,
0xff, 0xf7, 0x3f, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xef,
0x07, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x7f, 0xf3, 0xff, 0xcf, 0x7f, 0x00,
0xe0, 0xff, 0xff, 0xff, 0x1f, 0xfd, 0xff, 0xdf, 0x07, 0x00, 0xe0, 0xff,
0xff, 0xff, 0x83, 0xff, 0xf3, 0x9f, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x7f,
0x80, 0xff, 0xf9, 0xbf, 0x0f, 0x00, 0xf0, 0xff, 0xff, 0x00, 0x80, 0x7f,
0xfc, 0x7f, 0xff, 0x01, 0xf8, 0x3f, 0x7f, 0x00, 0x80, 0x81, 0xff, 0x7f,
0x1e, 0x00, 0x18, 0x9f, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0x7f, 0xfe, 0x07,
0x98, 0x8f, 0x1f, 0x00, 0xc0, 0xff, 0xcf, 0x7f, 0x3e, 0x00, 0xf8, 0x87,
0x0f, 0x00, 0xe0, 0xff, 0xe3, 0xff, 0xfe, 0x07, 0xf0, 0xc3, 0x07, 0x00,
0xf0, 0x1f, 0xfc, 0xff, 0x3c, 0x00, 0xf0, 0xe1, 0x03, 0x00, 0xf0, 0xc0,
0xff, 0xff, 0xfc, 0x0f, 0x60, 0xe0, 0x01, 0x00, 0xf8, 0xff, 0xff, 0xff,
0x7c, 0x00, 0x00, 0xf0, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xfc, 0x0f,
0x00, 0x70, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x7c, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xf9, 0x0f, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff,
0xff, 0xff, 0xf9, 0x0f, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
0xf9, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x1f,
0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xf1, 0x01, 0x00, 0x00,
0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xf1, 0x3f, 0x00, 0x00, 0x00, 0xf0,
0xff, 0xff, 0xff, 0xff, 0xf3, 0x01, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
0xff, 0xff, 0xf3, 0x3f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff,
0xf3, 0x01, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x3f,
0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x01, 0x00, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x3f, 0x00, 0x00, 0x00, 0xff,
0xff, 0xff, 0xff, 0xff, 0xf3, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
0xff, 0xff, 0xf3, 0x3f, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff,
0xf3, 0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x3f,
0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x01, 0x00, 0x00,
0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x3f, 0x00, 0x00, 0xe0, 0xff,
0xff, 0xff, 0xff, 0xff, 0xf3, 0x01, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xf3, 0x3f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
0xf3, 0x01, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x3f,
0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x01, 0x00, 0x00,
0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x3f, 0x00, 0x00, 0xfc, 0xff,
0xff, 0xff, 0xff, 0xff, 0xf3, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff,
0xff, 0xff, 0xf3, 0x3f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff,
0xf3, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x3f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,71 +0,0 @@
#define knight_mask_width 80
#define knight_mask_height 80
static char knight_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x0f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xbe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x03,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00,
0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xfc, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x0f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00,
0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x80, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x7f, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x7f, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xf8, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xf8, 0xff, 0xff, 0xff,
0xc7, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xc1, 0xff,
0xff, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0xff,
0xff, 0x0f, 0xfc, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x0f,
0xfc, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xfc, 0xdf,
0x3f, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xfc, 0xef, 0x1f, 0x00,
0xf8, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf8, 0xf7, 0x0f, 0x00, 0xfc, 0xff,
0xff, 0xff, 0xff, 0x1f, 0xf8, 0xfb, 0x07, 0x00, 0xfc, 0xff, 0xff, 0xff,
0xff, 0x1f, 0xf0, 0xf9, 0x03, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x1f,
0x00, 0xf8, 0x01, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xf8,
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x80,
0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff,
0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff,
0xff, 0x1f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00,
0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xfc,
0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff,
0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00,
0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xc0, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x7f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xf8, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x7f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,71 +0,0 @@
#define knight_outline_width 80
#define knight_outline_height 80
static char knight_outline_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x18, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x38, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf9, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x0f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x20, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x20, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x80,
0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x08, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xf0, 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
0x30, 0x58, 0x07, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x18, 0x4c,
0x04, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x78, 0x07, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x23, 0xe0, 0x01, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x80, 0x11, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00,
0x00, 0xc0, 0x08, 0x00, 0x00, 0x40, 0x00, 0x10, 0x00, 0x00, 0x00, 0x60,
0x04, 0x00, 0x00, 0x40, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x30, 0x02, 0x00,
0x00, 0x60, 0x00, 0x20, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x20,
0x00, 0xe0, 0x07, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x20, 0x00, 0x80,
0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x20, 0x00, 0x80, 0x07, 0x00,
0x00, 0x26, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x13,
0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x1f, 0x00, 0x00, 0x09, 0x40, 0x00,
0x00, 0x18, 0x08, 0x00, 0x02, 0x00, 0x80, 0x05, 0xc0, 0x00, 0x00, 0x0c,
0x0c, 0x00, 0x3e, 0x00, 0x80, 0x00, 0x80, 0x00, 0xc0, 0x03, 0x06, 0x00,
0x04, 0x00, 0xc0, 0x00, 0x80, 0x01, 0x70, 0x01, 0xc3, 0x00, 0x7c, 0x00,
0x60, 0x00, 0x00, 0x03, 0x1e, 0x81, 0x41, 0x00, 0x04, 0x00, 0x20, 0x00,
0x00, 0xce, 0x83, 0x61, 0x60, 0x00, 0xfc, 0x00, 0x30, 0x00, 0x80, 0x7f,
0x80, 0x1c, 0x30, 0x00, 0x08, 0x00, 0x10, 0xe0, 0xc1, 0x00, 0x80, 0x07,
0x10, 0x00, 0xf8, 0x01, 0x18, 0x30, 0x61, 0x00, 0x80, 0x00, 0x08, 0x00,
0x10, 0x00, 0x08, 0x98, 0x31, 0x00, 0xc0, 0x00, 0x0c, 0x00, 0xf0, 0x07,
0x08, 0x8c, 0x18, 0x00, 0x40, 0x00, 0x03, 0x00, 0x20, 0x00, 0x18, 0x86,
0x0c, 0x00, 0x60, 0xc0, 0x01, 0x00, 0xe0, 0x07, 0x10, 0xc3, 0x06, 0x00,
0x30, 0x30, 0x00, 0x00, 0x20, 0x00, 0xf0, 0x61, 0x02, 0x00, 0x10, 0x1e,
0x00, 0x00, 0xe0, 0x0f, 0x60, 0x30, 0x02, 0x00, 0x98, 0x03, 0x00, 0x00,
0x40, 0x00, 0x00, 0x10, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xc0, 0x0f,
0x00, 0xb0, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0xc0,
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00,
0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f,
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x30,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x20, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x04, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,15 +0,0 @@
#define knight_small_width 32
#define knight_small_height 32
static char knight_small_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x00, 0x00, 0xee, 0x7f, 0x02,
0x00, 0xfe, 0x7f, 0x01, 0x00, 0xff, 0xff, 0x04, 0x00, 0xff, 0xff, 0x02,
0x80, 0xff, 0xff, 0x09, 0xc0, 0xfc, 0xff, 0x07, 0xe0, 0xfc, 0xff, 0x11,
0xe0, 0xff, 0xff, 0x0d, 0xe0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x3f,
0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x7f, 0xf8, 0xff, 0xff, 0x07,
0xfc, 0xc7, 0xff, 0x7f, 0xfe, 0xc1, 0xff, 0x07, 0xfa, 0xc1, 0xff, 0x7f,
0xce, 0xc0, 0xff, 0x07, 0x6c, 0xc0, 0xff, 0x7f, 0x28, 0xe0, 0xff, 0x07,
0x00, 0xe0, 0xff, 0x7f, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0x7f,
0x00, 0xf0, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0xf8, 0xff, 0x0f,
0x00, 0xf8, 0xff, 0x7f, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0xff, 0xff, 0x7f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,15 +0,0 @@
#define knight_small_outline_width 32
#define knight_small_outline_height 32
static char knight_small_outline_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x00, 0x00, 0xee, 0x7f, 0x02,
0x00, 0x3a, 0x40, 0x01, 0x00, 0x03, 0xc0, 0x04, 0x00, 0x01, 0x80, 0x02,
0x80, 0x01, 0x80, 0x09, 0xc0, 0x0c, 0x00, 0x07, 0x60, 0x0c, 0x00, 0x11,
0x20, 0x00, 0x00, 0x0d, 0x20, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x3e,
0x10, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x7e, 0x18, 0x7c, 0x00, 0x04,
0x0c, 0x47, 0x00, 0x7c, 0x06, 0x41, 0x00, 0x04, 0xf2, 0x41, 0x00, 0x7c,
0xde, 0x40, 0x00, 0x04, 0x6c, 0x40, 0x00, 0x7c, 0x28, 0x60, 0x00, 0x04,
0x00, 0x20, 0x00, 0x7c, 0x00, 0x20, 0x00, 0x08, 0x00, 0x30, 0x00, 0x78,
0x00, 0x10, 0x00, 0x08, 0x00, 0x10, 0x00, 0x78, 0x00, 0x18, 0x00, 0x08,
0x00, 0x08, 0x00, 0x78, 0x00, 0x0c, 0x00, 0x08, 0x00, 0xff, 0xff, 0x7f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,102 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
static char rcsid[] = "$Id: message.c,v 1.2 1993/08/02 17:20:52 mycroft Exp $";
#endif /* not lint */
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*
* Do stuff with the message window. Font 0 is the normal font, font 1
* is large, and font 2 is normal red.
*/
#include "xchess.h"
#define MESSAGE_HEADER "\n1 XChess Messages0\n"
void
message_init(win)
windata *win;
{
TxtGrab(win->display, win->messagewin, "xchess", win->medium,
win->textback.pixel, win->textcolor.pixel,
win->cursorcolor.pixel);
TxtAddFont(win->display, win->messagewin, 1, win->large, win->textcolor.pixel);
TxtAddFont(win->display, win->messagewin, 2, win->medium, win->errortext.pixel);
TxtAddFont(win->display, win->messagewin, 3, win->medium, win->playertext.pixel);
TxtWriteStr(win->display, win->messagewin, MESSAGE_HEADER);
return;
}
void
message_add(win, string, err)
windata *win;
char *string;
bool err;
{
if (err) {
TxtWriteStr(win->display, win->messagewin, "2");
TxtWriteStr(win->display, win->messagewin, string);
TxtWriteStr(win->display, win->messagewin, "0");
XBell(win->display, 50);
} else
TxtWriteStr(win->display, win->messagewin, string);
XSync(win->display, 0);
return;
}
void
message_send(win, event)
windata *win;
XEvent *event;
{
XKeyEvent *ev = &event->xkey;
KeySym keysym;
windata *ow = (win == win1) ? win2 : win1;
char buf[BSIZE], *s;
int i;
i = XLookupString(ev, buf, sizeof(buf) - 1, &keysym, &s);
buf[i] = '\0';
for (s = buf; *s; s++)
if (*s == '\r')
*s = '\n';
else if (*s == '\177')
*s = '';
TxtWriteStr(win->display, win->messagewin, "3");
TxtWriteStr(win->display, win->messagewin, buf);
TxtWriteStr(win->display, win->messagewin, "0");
XSync(win->display, 0);
if (ow) {
TxtWriteStr(ow->display, ow->messagewin, "3");
TxtWriteStr(ow->display, ow->messagewin, buf);
TxtWriteStr(ow->display, ow->messagewin, "0");
XSync(ow->display, 0);
}
return;
}

View File

@ -1,388 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
static char rcsid[] = "$Id: parse.c,v 1.2 1993/08/02 17:20:53 mycroft Exp $";
#endif /* not lint */
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*
* Parse a sequence of chess moves...
*/
#include "xchess.h"
bool loading_flag = false;
bool loading_paused = false;
static char *line;
/* Load a record file in. This returns a number of things -- the board, the
* list of moves, and whose turn it is.
*/
void
load_game(file)
char *file;
{
FILE *fp;
char buf[BSIZE];
bool eflag;
move *m;
board *tmpboard = alloc(board);
if (eq(file, "xchess.game") && saveflag) {
message_add(win1,
"Oops, I just overwrote the\nfile xchess.game...\n",
true);
message_add(win1, "I hope you had another copy.\n", true);
return;
}
if (!(fp = fopen(file, "r"))) {
perror(file);
return;
}
/* Get a few lines... */
fgets(buf, BSIZE, fp);
message_add(win1, buf, false);
if (!oneboard)
message_add(win2, buf, false);
fgets(buf, BSIZE, fp);
message_add(win1, buf, false);
if (!oneboard)
message_add(win2, buf, false);
fgets(buf, BSIZE, fp);
if (eq(buf, "\tenglish\n"))
eflag = true;
else if (eq(buf, "\talgebraic\n"))
eflag = false;
else {
fprintf(stderr, "Can't decide whether this is english...\n");
return;
}
board_init(tmpboard);
line = NULL;
m = parse_file(fp, tmpboard, eflag);
tfree(tmpboard);
/* Now apply these moves to the board we were given... */
loading_flag = true;
while (m) {
if (!quickflag)
XSync(win1->display, 0);
win_process(true);
if (!quickflag)
sleep(1);
if (!loading_paused) {
prog_move(m);
m = m->next;
}
}
loading_flag = false;
if (line)
message_add(win1, line, false);
while (fgets(buf, BSIZE, fp))
message_add(win1, buf, false);
fclose(fp);
return;
}
/* Given a starting position (usually the beginning board configuration),
* read in a file of moves.
*/
move *
parse_file(fp, b, english)
FILE *fp;
board *b;
bool english;
{
move *mvs = NULL, *end = NULL;
char buf[BSIZE], *s, *t;
while (fgets(buf, BSIZE, fp)) {
if (*buf == '#')
continue;
s = buf;
/* The move number... */
if (!(t = gettok(&s)))
break;
if (!isdigit(*t)) {
line = copy(buf);
break;
}
if (!(t = gettok(&s)))
break;
if (end)
end = end->next = (english ? parse_move(b, t, WHITE) :
parse_imove(b, t, WHITE));
else
mvs = end = (english ? parse_move(b, t, WHITE) :
parse_imove(b, t, WHITE));
if (!end) {
fprintf(stderr, "Can't parse %s\n", buf);
return (NULL);
}
board_move(b, end);
if (!(t = gettok(&s)))
break;
if (end)
end = end->next = (english ? parse_move(b, t, BLACK) :
parse_imove(b, t, BLACK));
else
mvs = end = (english ? parse_move(b, t, BLACK) :
parse_imove(b, t, BLACK));
if (!end) {
fprintf(stderr, "Can't parse %s\n", buf);
return (NULL);
}
board_move(b, end);
}
return (mvs);
}
/* Parse a move. The move format accepted is as follows -
* move: spec-spec
* capture: specxspec
* kcastle: 2 o's
* qcastle: 3 o's
* A spec is either piece/pos, piece, or just pos. A pos consists of a column
* name followed by a row number. If the column name is kr, kn, kb, k, q,
* qb, qn, or qr, then the row number is according to the english system,
* or if it is a-h then it is according to the international system.
*
*** As of now the spec must include the position.
*/
move *
parse_move(b, str, w)
board *b;
char *str;
color w;
{
move *m = alloc(move);
char *s;
char spec1[16], spec2[16];
int i, j;
if (debug) fprintf(stderr, "parsing %s\n", str);
/* Check for castles. */
for (s = str, i = 0; *s; s++)
if ((*s == 'o') || (*s == 'O'))
i++;
if (i == 2) {
m->type = KCASTLE;
m->piece.type = KING;
m->piece.color = w;
return (m);
} else if (i == 3) {
m->type = QCASTLE;
m->piece.type = KING;
m->piece.color = w;
return (m);
}
if (index(str, '-'))
m->type = MOVE;
else if (index(str, 'x'))
m->type = CAPTURE;
else
return (NULL);
for (i = 0; str[i]; i++)
if ((str[i] == 'x') || (str[i] == '-'))
break;
else
spec1[i] = str[i];
spec1[i] = '\0';
for (i++, j = 0; str[i]; i++, j++)
if ((str[i] == 'x') || (str[i] == '-'))
break;
else
spec2[j] = str[i];
spec2[j] = '\0';
/* Now decode the specifications. */
s = spec1;
switch (*s) {
case 'p': case 'P':
m->piece.type = PAWN; break;
case 'r': case 'R':
m->piece.type = ROOK; break;
case 'n': case 'N':
m->piece.type = KNIGHT; break;
case 'b': case 'B':
m->piece.type = BISHOP; break;
case 'q': case 'Q':
m->piece.type = QUEEN; break;
case 'k': case 'K':
m->piece.type = KING; break;
default:
return (NULL);
}
m->piece.color = w;
s += 2;
/* Now get the {q,k}{,b,n,r}n string... */
if ((s[0] == 'q') && (s[1] == 'r'))
m->fromx = 0, s += 2;
else if ((s[0] == 'q') && (s[1] == 'n'))
m->fromx = 1, s += 2;
else if ((s[0] == 'q') && (s[1] == 'b'))
m->fromx = 2, s += 2;
else if ((s[0] == 'q') && isdigit(s[1]))
m->fromx = 3, s += 1;
else if ((s[0] == 'k') && isdigit(s[1]))
m->fromx = 4, s += 1;
else if ((s[0] == 'k') && (s[1] == 'b'))
m->fromx = 5, s += 2;
else if ((s[0] == 'k') && (s[1] == 'n'))
m->fromx = 6, s += 2;
else if ((s[0] == 'k') && (s[1] == 'r'))
m->fromx = 7, s += 2;
m->fromy = ((w == WHITE) ? (SIZE - atoi(s)) : (atoi(s) - 1));
if ((b->square[m->fromy][m->fromx].color != w) ||
(b->square[m->fromy][m->fromx].type != m->piece.type)) {
fprintf(stderr, "Error: bad stuff\n");
return (NULL);
}
s = spec2;
if (m->type == CAPTURE) {
switch (*s) {
case 'p': case 'P':
m->taken.type = PAWN; break;
case 'r': case 'R':
m->taken.type = ROOK; break;
case 'n': case 'N':
m->taken.type = KNIGHT; break;
case 'b': case 'B':
m->taken.type = BISHOP; break;
case 'q': case 'Q':
m->taken.type = QUEEN; break;
case 'k': case 'K':
m->taken.type = KING; break;
default:
return (NULL);
}
m->taken.color = ((w == WHITE) ? BLACK : WHITE);
s += 2;
}
/* Now get the {q,k}{,b,n,r}n string... */
if ((s[0] == 'q') && (s[1] == 'r'))
m->tox = 0, s += 2;
else if ((s[0] == 'q') && (s[1] == 'n'))
m->tox = 1, s += 2;
else if ((s[0] == 'q') && (s[1] == 'b'))
m->tox = 2, s += 2;
else if ((s[0] == 'q') && isdigit(s[1]))
m->tox = 3, s += 1;
else if ((s[0] == 'k') && isdigit(s[1]))
m->tox = 4, s += 1;
else if ((s[0] == 'k') && (s[1] == 'b'))
m->tox = 5, s += 2;
else if ((s[0] == 'k') && (s[1] == 'n'))
m->tox = 6, s += 2;
else if ((s[0] == 'k') && (s[1] == 'r'))
m->tox = 7, s += 2;
m->toy = ((w == WHITE) ? (SIZE - atoi(s)) : (atoi(s) - 1));
if ((m->type == CAPTURE) && ((b->square[m->toy][m->tox].color !=
m->taken.color) || (b->square[m->toy][m->tox].type !=
m->taken.type))) {
fprintf(stderr, "Error: bad stuff\n");
return (NULL);
}
return (m);
}
/* Parse an algebraic notation move. This is a lot easier... */
move *
parse_imove(b, buf, w)
board *b;
char *buf;
color w;
{
char *s;
move *m = alloc(move);
int n;
if (debug) fprintf(stderr, "(alg) parsing %s\n", buf);
for (s = buf, n = 0; *s; s++)
if ((*s == 'o') || (*s == 'O'))
n++;
s = buf;
if (n == 2)
m->type = KCASTLE;
else if (n == 3)
m->type = QCASTLE;
else {
m->fromx = *s++ - 'a';
m->fromy = SIZE - (*s++ - '0');
m->tox = *s++ - 'a';
m->toy = SIZE - (*s++ - '0');
m->piece = b->square[m->fromy][m->fromx];
m->taken = b->square[m->toy][m->tox];
if (m->taken.color == NONE)
m->type = MOVE;
else
m->type = CAPTURE;
/* for pawns we must account for en passant */
if (m->piece.type == PAWN) {
if (m->type == MOVE && m->fromx != m->tox) {
m->enpassant = 1;
m->type = CAPTURE;
}
}
}
if (m->piece.color != w) {
fprintf(stderr, "Error: parse_imove: piece of wrong color!\n");
return (NULL);
}
if ((m->piece.type == KING) && (m->fromy == m->toy) && (m->fromx == 4)
&& (m->tox == 6))
m->type = KCASTLE;
else if ((m->piece.type == KING) && (m->fromy == m->toy) &&
(m->fromx == 4) && (m->tox == 2))
m->type = QCASTLE;
return (m);
}

View File

@ -1,71 +0,0 @@
#define pawn_width 80
#define pawn_height 80
static char pawn_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xe0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff,
0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x3f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xe0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff,
0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf8, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x03,
0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff,
0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xc0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff,
0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x3f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00,
0x80, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff,
0x03, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00,
0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00,
0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xfe, 0xff,
0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff,
0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x1f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,71 +0,0 @@
#define pawn_mask_width 80
#define pawn_mask_height 80
static char pawn_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff,
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x07, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff,
0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff,
0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf0, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00,
0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,
0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff,
0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00,
0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,
0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x03,
0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x7f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff,
0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00,
0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf0, 0xff,
0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff,
0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff,
0x0f, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x80, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x3f, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3f, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,71 +0,0 @@
#define pawn_outline_width 80
#define pawn_outline_height 80
static char pawn_outline_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x70,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x18, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x80, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xe0, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x03, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0e, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xe0, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00,
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x20, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x30, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x18, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x06, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0xff, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x78, 0xc0, 0x81, 0x07, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0xc0, 0x7f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00,
0x80, 0x01, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x18, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,15 +0,0 @@
#define pawn_small_width 32
#define pawn_small_height 32
static char pawn_small_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xf0, 0x0f, 0x00,
0x00, 0xf8, 0x1f, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0xf8, 0x1f, 0x00,
0x00, 0xf8, 0x1f, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0xf0, 0x0f, 0x00,
0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x80, 0xff, 0xff, 0x01,
0x80, 0xff, 0xff, 0x01, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
0x00, 0xf0, 0x0f, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0xfc, 0x3f, 0x00,
0x00, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,15 +0,0 @@
#define pawn_small_outline_width 32
#define pawn_small_outline_height 32
static char pawn_small_outline_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x30, 0x0c, 0x00,
0x00, 0x18, 0x18, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00,
0x00, 0x08, 0x10, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x30, 0x0c, 0x00,
0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00, 0x80, 0x3f, 0xfc, 0x01,
0x80, 0x3f, 0xfc, 0x01, 0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00,
0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00,
0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00,
0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00,
0x00, 0xf0, 0x0f, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x0c, 0x30, 0x00,
0x00, 0x07, 0xe0, 0x00, 0xe0, 0x01, 0x80, 0x07, 0xf0, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,113 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
static char rcsid[] = "$Id: popup.c,v 1.2 1993/08/02 17:20:55 mycroft Exp $";
#endif /* not lint */
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* faustus@cad.berkeley.edu, ucbvax!faustus
* Permission is granted to modify and re-distribute this code in any manner
* as long as this notice is preserved. All standard disclaimers apply.
*
* A simple pop-up menu system.
*/
#include "xchess.h"
/* Open a small window with some text in it and two buttons -- yes and no.
* Use black and white pixel, and the medium font.
*/
bool
pop_question(win, text)
windata *win;
char *text;
{
char *s, *t;
int nlines = 1, ncols = 0, i = 0, j;
int x, y;
Window w;
bool ch;
XEvent ev;
for (s = text; *s; s++) {
if ((*s == '\n') && s[1])
nlines++;
if ((*s == '\n') || !s[1]) {
if (i > ncols)
ncols = i;
i = 0;
} else
i++;
}
if (ncols < 12)
ncols = 12;
nlines += 4;
ncols += 4;
x = (BASE_WIDTH - ncols * win->medium->max_bounds.width) / 2;
y = (BASE_HEIGHT - nlines * win->medium->max_bounds.ascent) / 2;
w = XCreateSimpleWindow(win->display, win->basewin,
x, y, ncols * win->medium->max_bounds.width,
nlines * win->medium->ascent,
BORDER_WIDTH, win->border.pixel,
win->textback.pixel);
XMapRaised(win->display, w);
XSetFont(win->display, DefaultGC(win->display, 0),
win->medium->fid);
for (i = 0, s = text; i < nlines - 4; i++) {
for (t = s, j = 0; *t && (*t != '\n'); t++, j++)
;
XDrawString(win->display, w, DefaultGC(win->display, 0),
(ncols - j) / 2 * win->medium->max_bounds.width,
(i + 1) * win->medium->ascent,
s, j);
s = t + 1;
}
XDrawString(win->display, w, DefaultGC(win->display, 0),
(ncols - 8) * win->medium->max_bounds.width / 4,
(nlines - 2) * win->medium->ascent,
"YES", 3);
XDrawString(win->display, w, DefaultGC(win->display, 0),
(ncols - 4) * win->medium->max_bounds.width * 3 / 4,
(nlines - 2) * win->medium->ascent,
"NO", 2);
XSync(win->display, 0);
XSelectInput(win->display, w, ButtonPressMask);
XWindowEvent(win->display, w, ButtonPressMask, &ev);
x = ev.xkey.x;
y = ev.xkey.y;
if (x > ncols * win->medium->max_bounds.width / 2)
ch = false;
else
ch = true;
XDestroyWindow(win->display, w);
XSync(win->display, 0);
return (ch);
}

View File

@ -1,201 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
static char rcsid[] = "$Id: program.c,v 1.2 1993/08/02 17:20:56 mycroft Exp $";
#endif /* not lint */
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*
* The interface to whichever chess playing program we are using...
*/
#include "xchess.h"
#include <signal.h>
#include <sys/time.h>
static int pid;
static FILE *from;
static FILE *to;
static bool easy = 1;
bool
program_init(name)
char *name;
{
int toprog[2], fromprog[2];
char buf[BSIZE];
char time[10];
char moves[10];
pipe(toprog);
pipe(fromprog);
if (!(pid = fork())) {
/* Start up the program. */
dup2(toprog[0], 0);
dup2(fromprog[1], 1);
close(toprog[0]);
close(toprog[1]);
close(fromprog[0]);
close(fromprog[1]);
sprintf (time, "%d", timeunit/60);
sprintf (moves, "%d", movesperunit);
if (proghost)
execl("/usr/ucb/rsh", "rsh", proghost, name,
moves, time,
(char *) NULL);
else
execl(name, name, moves, time, (char *) NULL);
perror(name);
exit(1);
}
close(toprog[0]);
close(fromprog[1]);
from = fdopen(fromprog[0], "r");
setbuf(from, NULL);
to = fdopen(toprog[1], "w");
setbuf(to, NULL);
/* Get the first line... */
fgets(buf, BSIZE, from);
if (debug)
fprintf(stderr, "program says %s", buf);
if (blackflag) {
fputs("switch\n", to);
fflush(to);
fgets(buf, BSIZE, from);
if (debug)
fprintf(stderr, "program says %s", buf);
message_add(win1, "GNU Chess playing white\n", false);
} else
message_add(win1, "GNU Chess playing black\n", false);
return (true);
}
void
program_end()
{
fclose(from);
fclose(to);
kill(pid, SIGTERM);
return;
}
void
program_send(m)
move *m;
{
char buf[BSIZE];
if ((m->type == MOVE) || (m->type == CAPTURE))
sprintf(buf, "%c%d%c%d\n", 'a' + m->fromx, SIZE - m->fromy,
'a' + m->tox, SIZE - m->toy);
else if (m->type == KCASTLE)
strcpy(buf, (m->piece.color == WHITE) ? "e1g1\n" : "e8g8\n");
else if (m->type == QCASTLE)
strcpy(buf, (m->piece.color == WHITE) ? "e1c1\n" : "e8c8\n");
if (debug)
fprintf(stderr, "sending program %s", buf);
if (!easy)
kill (pid, SIGINT);
fputs(buf, to);
fflush(to);
/* One junk line... */
fgets(buf, BSIZE, from);
if (debug)
fprintf(stderr, "program says %s", buf);
return;
}
move *
program_get()
{
int rfd = (1 << fileno(from)), wfd = 0, xfd = 0;
static struct timeval notime = { 0, 0 };
char buf[BSIZE], *s;
move *m;
int i;
/* Do a poll... */
if (!(i = select(32, &rfd, &wfd, &xfd, &notime)) &&
!from->_cnt) { /* Bad stuff... */
if (debug)
fprintf(stderr, "poll: nothing\n");
return (NULL);
}
if (i == -1) {
perror("select");
return (NULL);
}
fgets(buf, BSIZE, from);
if (*buf == '\n' || *buf == '\0') {
message_add(win1, "program died", false);
return (NULL);
}
if (debug)
fprintf(stderr, "got from program %s", buf);
for (s = buf; !isalpha(*s); s++)
;
m = parse_imove(chessboard, s, nexttomove);
if (m == NULL)
return (NULL);
if (!valid_move(m, chessboard)) {
fprintf(stderr, "Error: move %s is invalid!!\n", buf);
return (NULL);
}
/*
fgets(buf, BSIZE, from);
if (debug)
fprintf(stderr, "program says %s", buf);
*/
message_add(win1, buf, false);
return (m);
}
void
program_undo()
{
fputs("undo\n", to);
return;
}
void
program_easy (mode)
bool mode;
{
fputs("easy\n", to);
easy = mode;
}

View File

@ -1,71 +0,0 @@
#define queen_width 80
#define queen_height 80
static char queen_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x80, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x80, 0x01, 0x00, 0x07,
0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x80, 0x01, 0x80, 0x0f, 0x00, 0x00,
0x00, 0x00, 0xf0, 0x01, 0xc0, 0x03, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00,
0xe0, 0x00, 0xc0, 0x03, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
0xc0, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xc0, 0x03,
0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xc0, 0x03, 0x00, 0x03,
0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xc0, 0x03, 0x00, 0x03, 0x00, 0x00,
0x00, 0x00, 0xc0, 0x01, 0xc0, 0x03, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00,
0xc0, 0x01, 0xc0, 0x03, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01,
0xe0, 0x07, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xe0, 0x07,
0xc0, 0x03, 0x00, 0x00, 0x1c, 0x00, 0xc0, 0x03, 0xe0, 0x07, 0xc0, 0x03,
0x00, 0x00, 0x3e, 0x00, 0xc0, 0x03, 0xe0, 0x07, 0xc0, 0x03, 0x00, 0x0e,
0x3e, 0x00, 0xc0, 0x07, 0xe0, 0x07, 0xe0, 0x03, 0x00, 0x1f, 0x3e, 0x00,
0xc0, 0x07, 0xe0, 0x07, 0xe0, 0x03, 0x00, 0x1f, 0x3c, 0x00, 0xc0, 0x07,
0xe0, 0x07, 0xe0, 0x03, 0x00, 0x1f, 0x70, 0x00, 0xc0, 0x0f, 0xe0, 0x07,
0xf0, 0x03, 0x00, 0x0e, 0x60, 0x00, 0xc0, 0x0f, 0xe0, 0x07, 0xf0, 0x03,
0x00, 0x03, 0xe0, 0x00, 0xc0, 0x0f, 0xf0, 0x0f, 0xf0, 0x03, 0x80, 0x03,
0xc0, 0x01, 0xc0, 0x1f, 0xf0, 0x0f, 0xf8, 0x03, 0x80, 0x01, 0xc0, 0x01,
0xc0, 0x1f, 0xf0, 0x0f, 0xf8, 0x03, 0xc0, 0x01, 0xc0, 0x03, 0xc0, 0x1f,
0xf0, 0x0f, 0xf8, 0x03, 0xe0, 0x01, 0xc0, 0x07, 0xc0, 0x1f, 0xf0, 0x0f,
0xf8, 0x03, 0xe0, 0x01, 0xc0, 0x07, 0xc0, 0x3f, 0xf0, 0x0f, 0xfc, 0x03,
0xf0, 0x01, 0xc0, 0x0f, 0xc0, 0x3f, 0xf0, 0x0f, 0xfc, 0x03, 0xf8, 0x01,
0x80, 0x1f, 0xc0, 0x3f, 0xf0, 0x0f, 0xfc, 0x03, 0xf8, 0x01, 0x80, 0x1f,
0xc0, 0x7f, 0xf0, 0x0f, 0xfe, 0x03, 0xfc, 0x01, 0x80, 0x3f, 0xc0, 0x7f,
0xf8, 0x1f, 0xfe, 0x03, 0xfc, 0x00, 0x80, 0x3f, 0xc0, 0x7f, 0xf8, 0x1f,
0xfe, 0x03, 0xfe, 0x00, 0x80, 0x7f, 0xc0, 0xff, 0xf8, 0x1f, 0xff, 0x03,
0xff, 0x00, 0x80, 0xff, 0xc0, 0xff, 0xf8, 0x1f, 0xff, 0x03, 0xff, 0x00,
0x00, 0xff, 0xc0, 0xff, 0xf8, 0x1f, 0xff, 0x83, 0xff, 0x00, 0x00, 0xff,
0xc1, 0xff, 0xf9, 0x9f, 0xff, 0x83, 0xff, 0x00, 0x00, 0xff, 0xc3, 0xff,
0xf9, 0x9f, 0xff, 0xc3, 0xff, 0x00, 0x00, 0xff, 0xc3, 0xff, 0xf9, 0x9f,
0xff, 0xe3, 0x7f, 0x00, 0x00, 0xff, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xe3,
0x7f, 0x00, 0x00, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x7f, 0x00,
0x00, 0xfe, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xfb, 0x7f, 0x00, 0x00, 0xfe,
0xdf, 0xff, 0xff, 0xff, 0xff, 0xfb, 0x7f, 0x00, 0x00, 0xfe, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x7f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x7f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xfc,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xfc, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x01, 0x80,
0xff, 0xff, 0x3f, 0x00, 0x00, 0xf8, 0xff, 0x03, 0xfc, 0x3f, 0xc0, 0xff,
0x1f, 0x00, 0x00, 0xf0, 0x01, 0xf8, 0x7f, 0xfe, 0x1f, 0x80, 0x1f, 0x00,
0x00, 0x30, 0xfc, 0xff, 0x1f, 0xf8, 0xff, 0x3f, 0x0c, 0x00, 0x00, 0xe0,
0xe7, 0xff, 0x07, 0xe0, 0xff, 0xe7, 0x07, 0x00, 0x00, 0xc0, 0x81, 0xff,
0x1f, 0xf8, 0xff, 0x81, 0x03, 0x00, 0x00, 0x80, 0x00, 0xfe, 0x7f, 0xfe,
0x7f, 0x00, 0x03, 0x00, 0x00, 0x80, 0x81, 0xff, 0xff, 0xff, 0xff, 0x81,
0x01, 0x00, 0x00, 0x00, 0xe7, 0xff, 0x01, 0x80, 0xff, 0xe7, 0x00, 0x00,
0x00, 0x00, 0xff, 0x03, 0xfc, 0x3f, 0xc0, 0xff, 0x00, 0x00, 0x00, 0x80,
0x01, 0xf8, 0xff, 0xff, 0x1f, 0x80, 0x01, 0x00, 0x00, 0x80, 0xfc, 0xff,
0xff, 0xff, 0xff, 0x3f, 0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x03, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,
0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xe0,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xe0, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,71 +0,0 @@
#define queen_mask_width 80
#define queen_mask_height 80
static char queen_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x60, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01,
0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0xc0, 0x03,
0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0xc0, 0x03, 0xc0, 0x1f,
0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0xe0, 0x07, 0xc0, 0x1f, 0x00, 0x00,
0x00, 0x00, 0xf8, 0x03, 0xe0, 0x07, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00,
0xf8, 0x01, 0xe0, 0x07, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01,
0xe0, 0x07, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xe0, 0x07,
0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xe0, 0x07, 0x80, 0x07,
0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0xe0, 0x07, 0x80, 0x07, 0x00, 0x00,
0x00, 0x00, 0xe0, 0x03, 0xf0, 0x0f, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00,
0xe0, 0x07, 0xf0, 0x0f, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07,
0xf0, 0x0f, 0xc0, 0x07, 0x00, 0x00, 0x7e, 0x00, 0xe0, 0x07, 0xf0, 0x0f,
0xe0, 0x07, 0x00, 0x00, 0x7f, 0x00, 0xe0, 0x0f, 0xf0, 0x0f, 0xe0, 0x07,
0x00, 0x1f, 0x7f, 0x00, 0xe0, 0x0f, 0xf0, 0x0f, 0xe0, 0x07, 0x80, 0x3f,
0x7f, 0x00, 0xe0, 0x0f, 0xf0, 0x0f, 0xf0, 0x07, 0x80, 0x3f, 0x7f, 0x00,
0xe0, 0x0f, 0xf0, 0x0f, 0xf0, 0x07, 0x80, 0x3f, 0xff, 0x00, 0xe0, 0x1f,
0xf0, 0x0f, 0xf0, 0x07, 0x80, 0x3f, 0xfe, 0x00, 0xe0, 0x1f, 0xf0, 0x0f,
0xf8, 0x07, 0x80, 0x1f, 0xfc, 0x01, 0xe0, 0x1f, 0xf8, 0x1f, 0xf8, 0x07,
0x80, 0x1f, 0xf0, 0x03, 0xe0, 0x3f, 0xf8, 0x1f, 0xf8, 0x07, 0xc0, 0x0f,
0xf0, 0x07, 0xe0, 0x3f, 0xf8, 0x1f, 0xfc, 0x07, 0xe0, 0x03, 0xe0, 0x07,
0xe0, 0x3f, 0xf8, 0x1f, 0xfc, 0x07, 0xf0, 0x03, 0xe0, 0x0f, 0xe0, 0x7f,
0xf8, 0x1f, 0xfc, 0x07, 0xf0, 0x03, 0xe0, 0x1f, 0xe0, 0x7f, 0xf8, 0x1f,
0xfc, 0x07, 0xf8, 0x03, 0xe0, 0x1f, 0xe0, 0x7f, 0xf8, 0x1f, 0xfe, 0x07,
0xf8, 0x03, 0xe0, 0x3f, 0xe0, 0x7f, 0xf8, 0x1f, 0xfe, 0x07, 0xfc, 0x03,
0xe0, 0x3f, 0xe0, 0xff, 0xf8, 0x1f, 0xfe, 0x07, 0xfe, 0x03, 0xc0, 0x7f,
0xe0, 0xff, 0xfc, 0x3f, 0xff, 0x07, 0xfe, 0x03, 0xc0, 0xff, 0xe0, 0xff,
0xfd, 0x3f, 0xff, 0x07, 0xff, 0x03, 0xc0, 0xff, 0xe1, 0xff, 0xfd, 0xff,
0xff, 0x87, 0xff, 0x03, 0xc0, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xff, 0x87,
0xff, 0x01, 0xc0, 0xff, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xff, 0x01,
0xc0, 0xff, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xff, 0x01, 0x80, 0xff,
0xef, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xff, 0x01, 0x80, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xe7, 0xff, 0x01, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xf7, 0xff, 0x01, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xfe,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xfe, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x7f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x7f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf8,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xf0, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x07, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x07, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,
0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xc0,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x07, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00,
0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,71 +0,0 @@
#define queen_outline_width 80
#define queen_outline_height 80
static char queen_outline_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x60, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x80, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x01, 0x80, 0x01, 0x00, 0x07,
0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0x80, 0x01, 0x80, 0x0d, 0x00, 0x00,
0x00, 0x00, 0xb0, 0x01, 0xc0, 0x03, 0x80, 0x08, 0x00, 0x00, 0x00, 0x00,
0xe0, 0x00, 0x40, 0x02, 0x80, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
0x40, 0x02, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x02,
0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x02, 0x00, 0x03,
0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x02, 0x00, 0x03, 0x00, 0x00,
0x00, 0x00, 0xc0, 0x01, 0x40, 0x02, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00,
0x40, 0x01, 0x40, 0x02, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01,
0x60, 0x06, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x40, 0x03, 0x20, 0x04,
0xc0, 0x02, 0x00, 0x00, 0x1c, 0x00, 0x40, 0x02, 0x20, 0x04, 0x40, 0x02,
0x00, 0x00, 0x36, 0x00, 0x40, 0x02, 0x20, 0x04, 0x40, 0x02, 0x00, 0x0e,
0x22, 0x00, 0x40, 0x06, 0x20, 0x04, 0x60, 0x02, 0x00, 0x1b, 0x36, 0x00,
0x40, 0x04, 0x20, 0x04, 0x20, 0x02, 0x00, 0x11, 0x3c, 0x00, 0x40, 0x04,
0x20, 0x04, 0x20, 0x02, 0x00, 0x1b, 0x70, 0x00, 0x40, 0x0c, 0x20, 0x04,
0x30, 0x02, 0x00, 0x0e, 0x60, 0x00, 0x40, 0x08, 0x20, 0x04, 0x10, 0x02,
0x00, 0x03, 0xe0, 0x00, 0x40, 0x08, 0x30, 0x0c, 0x10, 0x02, 0x80, 0x03,
0xc0, 0x01, 0x40, 0x18, 0x10, 0x08, 0x18, 0x02, 0x80, 0x01, 0x40, 0x01,
0x40, 0x10, 0x10, 0x08, 0x08, 0x02, 0xc0, 0x01, 0x40, 0x03, 0x40, 0x10,
0x10, 0x08, 0x08, 0x02, 0x60, 0x01, 0x40, 0x06, 0x40, 0x10, 0x10, 0x08,
0x08, 0x02, 0x20, 0x01, 0x40, 0x04, 0x40, 0x30, 0x10, 0x08, 0x0c, 0x02,
0x30, 0x01, 0xc0, 0x0c, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x18, 0x01,
0x80, 0x18, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x08, 0x01, 0x80, 0x10,
0x40, 0x60, 0x10, 0x08, 0x06, 0x02, 0x8c, 0x01, 0x80, 0x30, 0x40, 0x40,
0x18, 0x18, 0x02, 0x02, 0x84, 0x00, 0x80, 0x20, 0x40, 0x40, 0x08, 0x10,
0x02, 0x02, 0x86, 0x00, 0x80, 0x60, 0x40, 0xc0, 0x08, 0x10, 0x03, 0x02,
0x83, 0x00, 0x80, 0xc1, 0x40, 0x80, 0x08, 0x10, 0x01, 0x02, 0x81, 0x00,
0x00, 0x81, 0x40, 0x80, 0x08, 0x10, 0x01, 0x82, 0x81, 0x00, 0x00, 0x81,
0x41, 0x80, 0x09, 0x90, 0x01, 0x82, 0x80, 0x00, 0x00, 0x01, 0x43, 0x00,
0x09, 0x90, 0x00, 0xc2, 0xc0, 0x00, 0x00, 0x01, 0x42, 0x00, 0x09, 0x90,
0x00, 0x62, 0x40, 0x00, 0x00, 0x01, 0x46, 0x00, 0x0f, 0xf0, 0x00, 0x22,
0x40, 0x00, 0x00, 0x03, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x32, 0x40, 0x00,
0x00, 0x02, 0x48, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x40, 0x00, 0x00, 0x02,
0x58, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x40, 0x00, 0x00, 0x02, 0x70, 0x00,
0x00, 0x00, 0x00, 0x0e, 0x40, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x40, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x60, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x0c, 0x00, 0x00, 0xfe, 0x7f,
0x00, 0x00, 0x30, 0x00, 0x00, 0x18, 0x00, 0xfc, 0x03, 0xc0, 0x3f, 0x00,
0x10, 0x00, 0x00, 0x10, 0xfe, 0x07, 0x80, 0x01, 0xe0, 0x7f, 0x18, 0x00,
0x00, 0x30, 0x03, 0x00, 0xe0, 0x07, 0x00, 0xc0, 0x0c, 0x00, 0x00, 0x60,
0x18, 0x00, 0xf8, 0x1f, 0x00, 0x18, 0x06, 0x00, 0x00, 0x40, 0x7e, 0x00,
0xe0, 0x07, 0x00, 0x7e, 0x02, 0x00, 0x00, 0x40, 0xff, 0x01, 0x80, 0x01,
0x80, 0xff, 0x02, 0x00, 0x00, 0x40, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x7e,
0x02, 0x00, 0x00, 0xc0, 0x18, 0x00, 0xfe, 0x7f, 0x00, 0x18, 0x03, 0x00,
0x00, 0x80, 0x00, 0xfc, 0x03, 0xc0, 0x3f, 0x00, 0x01, 0x00, 0x00, 0x80,
0xfe, 0x07, 0x00, 0x00, 0xe0, 0x7f, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x60,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0xe0, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,15 +0,0 @@
#define queen_small_width 32
#define queen_small_height 32
static char queen_small_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x00, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00,
0x80, 0x81, 0xc0, 0x00, 0x80, 0x81, 0xc0, 0x00, 0x00, 0xc1, 0x41, 0x00,
0x00, 0xc1, 0x41, 0x00, 0x02, 0xc3, 0x61, 0x20, 0x06, 0xc3, 0x61, 0x30,
0x04, 0xc3, 0x61, 0x10, 0x0c, 0xc3, 0x61, 0x18, 0x08, 0xc7, 0x71, 0x08,
0x18, 0xc6, 0x31, 0x0c, 0x38, 0xc6, 0x31, 0x0e, 0x30, 0xce, 0x39, 0x06,
0x70, 0xce, 0x39, 0x07, 0x60, 0xee, 0x3b, 0x03, 0xe0, 0xee, 0xbb, 0x03,
0xe0, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0x01,
0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, 0xff, 0x7f, 0x00,
0x80, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,15 +0,0 @@
#define queen_small_outline_width 32
#define queen_small_outline_height 32
static char queen_small_outline_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x00, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00,
0x80, 0x81, 0xc0, 0x00, 0x80, 0x81, 0xc0, 0x00, 0x00, 0xc1, 0x41, 0x00,
0x00, 0x41, 0x41, 0x00, 0x02, 0x43, 0x61, 0x20, 0x06, 0x43, 0x61, 0x30,
0x04, 0x43, 0x61, 0x10, 0x0c, 0x43, 0x61, 0x18, 0x08, 0x47, 0x71, 0x08,
0x18, 0x46, 0x31, 0x0c, 0x38, 0x46, 0x31, 0x0e, 0x30, 0x4e, 0x39, 0x06,
0x70, 0x4e, 0x29, 0x07, 0x60, 0x6a, 0x2b, 0x03, 0xe0, 0x2a, 0xab, 0x03,
0xe0, 0x3b, 0xee, 0x03, 0x40, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x80, 0x01,
0x80, 0xfc, 0x9f, 0x00, 0x80, 0x01, 0xc0, 0x00, 0x00, 0x01, 0x40, 0x00,
0x80, 0xfd, 0xdf, 0x00, 0xf0, 0x00, 0x80, 0x07, 0xf0, 0xff, 0xff, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,316 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
static char rcsid[] = "$Id: record.c,v 1.2 1993/08/02 17:20:57 mycroft Exp $";
#endif /* not lint */
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*
* Deal with recording moves.
*/
#include "xchess.h"
#undef smartass
bool record_english = true;
char *record_file = DEF_RECORD_FILE;
int movenum = 0;
bool saveflag = false;
static char *colnames[] = { "qr", "qn", "qb", "q", "k", "kb", "kn", "kr" } ;
static char *pcnames[] = { "P", "R", "N", "B", "Q", "K" } ;
static char *movestring();
static char *tstring();
static FILE *backup;
#define RECORD_HEADER "\n1 XChess Game Record0\n"
void
record_init(win)
windata *win;
{
int i;
i = XTextWidth(win->medium, RECORD_HEADER,
sizeof(RECORD_HEADER) - 1);
i = (40 * win->small->max_bounds.width - i *
win->medium->max_bounds.width) /
win->medium->max_bounds.width / 2;
TxtGrab(win->display, win->recwin, "xchess", win->small, win->textback.pixel,
win->textcolor.pixel, win->cursorcolor.pixel);
TxtAddFont(win->display, win->recwin, 1, win->medium, win->textcolor.pixel);
for (; i > 0; i++)
TxtWriteStr(win->display, win->recwin, " ");
TxtWriteStr(win->display, win->recwin, RECORD_HEADER);
if (saveflag) {
if (!(backup = fopen(record_file, "w"))) {
perror(record_file);
saveflag = false;
} else {
fprintf(backup, "X Chess -- %s\n", datestring());
if (dispname2)
fprintf(backup, "\tWhite on %s, black on %s\n",
dispname1, dispname2);
else
fprintf(backup, "\tGame played on %s\n",
dispname1);
fprintf(backup, "\t%s\n", record_english ? "english" :
"algebraic");
fflush(backup);
}
}
movenum = 0;
return;
}
void
record_reset()
{
TxtWriteStr(win1->display, win1->recwin, "\n\n1 New Game0\n\n");
if (!oneboard) {
TxtWriteStr(win2->display, win2->recwin, "\n\n1 New Game0\n\n");
}
movenum = 0;
if (saveflag) {
fprintf(backup, "\n\nNew Game\n\n");
fflush(backup);
}
return;
}
void
record_end(s)
char *s;
{
char buf[BSIZE];
sprintf(buf, "\n%s\n", s);
TxtWriteStr(win1->display, win1->recwin, s);
if (!oneboard) {
TxtWriteStr(win2->display, win2->recwin, s);
}
if (saveflag) {
fprintf(backup, "\n%s\n", s);
fprintf(backup, "Time: white: %s, ", tstring(whiteseconds));
fprintf(backup, "black: %s\n", tstring(blackseconds));
fclose(backup);
}
return;
}
void
record_save()
{
move *m;
FILE *fp;
int i;
char *s;
if (!(fp = fopen(record_file, "w"))) {
perror(record_file);
return;
}
fprintf(fp, "X Chess -- %s\n", datestring());
if (dispname2)
fprintf(fp, "\tWhite on %s, black on %s\n",
dispname1, dispname2);
else
fprintf(fp, "\tGame played on %s\n", dispname1);
fprintf(fp, "\t%s\n", record_english ? "english" : "algebraic");
for (m = moves, i = 1; m; i++) {
s = movestring(m);
fprintf(fp, "%2d. %-16s ", i, s);
m = m->next;
if (m)
s = movestring(m);
else
s = "";
fprintf(fp, "%s\n", s);
if (m)
m = m->next;
}
fclose(fp);
return;
}
void
record_move(m)
move *m;
{
char *s, buf[BSIZE];
s = movestring(m);
if (m->piece.color == WHITE) {
movenum++;
sprintf(buf, "%2d. %-16s ", movenum, s);
} else {
sprintf(buf, "%s\n", s);
}
TxtWriteStr(win1->display, win1->recwin, buf);
if (!oneboard) {
TxtWriteStr(win2->display, win2->recwin, buf);
}
if (saveflag) {
fprintf(backup, "%s", buf);
fflush(backup);
}
return;
}
void
record_back()
{
extern move *lastmove;
move *m = lastmove;
char *s = movestring(m);
char buf[BSIZE];
long i;
if (m->piece.color == WHITE) {
sprintf(buf, "%2d. %-16s ", movenum, s);
} else {
sprintf(buf, "%s\n", s);
}
s = buf;
for (i = 0; *s != '\0'; i++)
*s++ = ''; /* control H, backspace */
TxtWriteStr(win1->display, win1->recwin, buf);
if (!oneboard) {
TxtWriteStr(win2->display, win2->recwin, buf);
}
if (nexttomove == BLACK)
movenum--;
if (saveflag) {
fseek(backup, -i, 1);
fflush(backup);
}
return;
}
static char *
movestring(m)
move *m;
{
int fy, ty;
static char buf[BSIZE];
if (!record_english || (m->piece.color == WHITE)) {
fy = SIZE - m->fromy;
ty = SIZE - m->toy;
} else {
fy = m->fromy + 1;
ty = m->toy + 1;
}
switch (m->type) {
case MOVE:
if (record_english)
sprintf(buf, "%s/%s%d-%s%d%s", pcnames[(int) m->piece.
type], colnames[m->fromx], fy,
colnames[m->tox], ty, m->check ? "+" :
"");
else
sprintf(buf, "%c%d%c%d", 'a' + m->fromx, fy, 'a' +
m->tox, ty);
break;
case CAPTURE:
if (record_english)
sprintf(buf, "%s/%s%dx%s/%s%d%s%s",
pcnames[(int) m->piece.type],
colnames[m->fromx], fy,
pcnames[(int) m->taken.type],
colnames[m->tox], ty,
m->enpassant ? "e.p." : "",
m->check ? "+" : "");
else
sprintf(buf, "%c%d%c%d", 'a' + m->fromx, fy, 'a' +
m->tox, ty);
break;
case KCASTLE:
if (record_english)
sprintf(buf, "O-O%s", m->check ? "ch" : "");
else if (m->piece.color == WHITE)
strcpy(buf, "e1g1");
else
strcpy(buf, "e8g8");
break;
case QCASTLE:
if (record_english)
sprintf(buf, "O-O-O%s", m->check ? "ch" : "");
else if (m->piece.color == WHITE)
strcpy(buf, "e1c1");
else
strcpy(buf, "e8c8");
break;
default:
sprintf(buf, "something strange");
break;
}
if ((m->piece.type == PAWN) && (((m->piece.color == BLACK) &&
(m->toy == 7)) || ((m->piece.color == WHITE) &&
(m->toy == 0))))
strcat(buf, "(Q)");
#ifdef smartass
if (!(random() % 50))
strcat(buf, "?");
else if (!(random() % 50))
strcat(buf, "!");
else if (!(random() % 500))
strcat(buf, "???");
else if (!(random() % 500))
strcat(buf, "!!!");
#endif smartass
return (buf);
}
static char *
tstring(s)
int s;
{
static char buf[64];
if (s > 3600)
sprintf(buf, "%dh %dm %ds", s / 3600, (s % 3600) / 60, s % 60);
else if (s > 60)
sprintf(buf, "%dm %ds", (s % 3600) / 60, s % 60);
else
sprintf(buf, "%ds", s);
return (buf);
}

View File

@ -1,71 +0,0 @@
#define rook_width 80
#define rook_height 80
static char rook_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf8, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xf8, 0xff, 0x00, 0x3c,
0x00, 0x00, 0x00, 0x80, 0xff, 0x01, 0xf8, 0xff, 0x00, 0xfc, 0x0f, 0x00,
0x00, 0xc0, 0xff, 0x01, 0xf8, 0xff, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0xc0,
0xff, 0x01, 0xf8, 0xff, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0x01,
0xf8, 0xff, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0x01, 0xff, 0xff,
0x07, 0xfc, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xfd, 0x01, 0x00, 0xfc, 0xfd,
0x1f, 0x00, 0x00, 0xc0, 0xff, 0x07, 0xfc, 0xff, 0x01, 0xff, 0x1f, 0x00,
0x00, 0xc0, 0x1f, 0xf0, 0xff, 0xff, 0x7f, 0xc0, 0x1f, 0x00, 0x00, 0x40,
0xc0, 0xff, 0x07, 0x00, 0xff, 0x1f, 0x10, 0x00, 0x00, 0xc0, 0xff, 0x1f,
0xf0, 0x7f, 0xc0, 0xff, 0x1f, 0x00, 0x00, 0xc0, 0x7f, 0xc0, 0xfd, 0xff,
0x1d, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f,
0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f, 0x00, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f, 0x00, 0x00, 0x00, 0x00,
0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
0xfd, 0xff, 0xfd, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff,
0xfd, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f,
0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f, 0x00, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f, 0x00, 0x00, 0x00, 0x00,
0xc0, 0x7f, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
0xff, 0xfe, 0x07, 0x10, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xfe,
0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xfe, 0xff, 0x1f,
0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xfe, 0xff, 0x1f, 0x00, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xff, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00,
0xc0, 0xff, 0xff, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
0xff, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xfe,
0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xfe, 0xff, 0x1f,
0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xfe, 0xff, 0x1f, 0x00, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xff, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00,
0xc0, 0xff, 0xff, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
0x0f, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0xe0, 0x3f,
0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f,
0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f, 0x00, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f, 0x00, 0x00, 0x00, 0x00,
0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
0xfd, 0xff, 0xfd, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff,
0xfd, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f,
0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f, 0x00, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f, 0x00, 0x00, 0x00, 0x00,
0xc0, 0xff, 0xfd, 0xff, 0xfd, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
0xfd, 0xff, 0xfd, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xfd, 0xff, 0x1f,
0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xfd, 0xff, 0x1f, 0x00, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xff, 0xfd, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00,
0xc0, 0xff, 0xff, 0xfd, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
0xff, 0xfd, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xfd,
0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xfd, 0xff, 0x1f,
0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xfd, 0xff, 0x1f, 0x00, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xff, 0xfd, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00,
0xc0, 0xff, 0xff, 0xfd, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
0xff, 0xfd, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xfd,
0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x10,
0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x07, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x60,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x20, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,71 +0,0 @@
#define rook_mask_width 80
#define rook_mask_height 80
static char rook_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfc, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0xfc, 0xff,
0x01, 0x7e, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0xfc, 0xff, 0x01, 0xfe,
0x1f, 0x00, 0x00, 0xe0, 0xff, 0x03, 0xfc, 0xff, 0x01, 0xfe, 0x3f, 0x00,
0x00, 0xe0, 0xff, 0x03, 0xfc, 0xff, 0x01, 0xfe, 0x3f, 0x00, 0x00, 0xe0,
0xff, 0x03, 0xfc, 0xff, 0x1f, 0xfe, 0x3f, 0x00, 0x00, 0xe0, 0xff, 0x83,
0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x3f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xe0,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xe0, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x3f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff,
0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f,
0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff,
0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f,
0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff,
0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f,
0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff,
0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f,
0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff,
0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f,
0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff,
0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f,
0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff,
0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f,
0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff,
0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff,
0x01, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x0f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x1f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xf0,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x7f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,71 +0,0 @@
#define rook_outline_width 80
#define rook_outline_height 80
static char rook_outline_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf8, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x08, 0x80, 0x00, 0x3c,
0x00, 0x00, 0x00, 0x80, 0x3f, 0x01, 0x08, 0x80, 0x00, 0xe4, 0x0f, 0x00,
0x00, 0xc0, 0x00, 0x01, 0x08, 0x80, 0x00, 0x04, 0x18, 0x00, 0x00, 0x40,
0x00, 0x01, 0x08, 0x80, 0x00, 0x04, 0x10, 0x00, 0x00, 0x40, 0x00, 0x01,
0x08, 0x80, 0x00, 0x04, 0x10, 0x00, 0x00, 0x40, 0x00, 0x01, 0x0f, 0x80,
0x07, 0x04, 0x10, 0x00, 0x00, 0x40, 0x00, 0xfd, 0x01, 0x00, 0xfc, 0x05,
0x10, 0x00, 0x00, 0x40, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x10, 0x00,
0x00, 0x40, 0x00, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x10, 0x00, 0x00, 0x40,
0x00, 0xf0, 0x07, 0x00, 0x7f, 0x00, 0x10, 0x00, 0x00, 0x40, 0xc0, 0x1f,
0x00, 0x00, 0xc0, 0x1f, 0x10, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x02, 0x00,
0x02, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x00, 0x02, 0x10,
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x00, 0x02, 0x10, 0x00, 0x00,
0x00, 0x00, 0x40, 0x00, 0x02, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00,
0x40, 0x00, 0x02, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
0x02, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x00,
0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x00, 0x02, 0x10,
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x00, 0x02, 0x10, 0x00, 0x00,
0x00, 0x00, 0x40, 0x00, 0x02, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00,
0x40, 0x80, 0xff, 0xff, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
0x00, 0x01, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01,
0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x00, 0x10,
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
0x40, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01,
0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x00, 0x10,
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
0x40, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
0xf0, 0x7f, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0xc0,
0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x00, 0x02, 0x10,
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x00, 0x02, 0x10, 0x00, 0x00,
0x00, 0x00, 0x40, 0x00, 0x02, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00,
0x40, 0x00, 0x02, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
0x02, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x00,
0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x00, 0x02, 0x10,
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x00, 0x02, 0x10, 0x00, 0x00,
0x00, 0x00, 0x40, 0x00, 0x02, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00,
0x40, 0x00, 0x02, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
0x02, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff,
0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x02, 0x00, 0x10,
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x40, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
0x40, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
0x00, 0x02, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x02,
0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x02, 0x00, 0x10,
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x40, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
0x40, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
0x00, 0x02, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x02,
0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x1f,
0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x07, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x60,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x20, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,15 +0,0 @@
#define rook_small_width 32
#define rook_small_height 32
static char rook_small_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xc0, 0x73, 0xce, 0x03, 0xc0, 0x73, 0xce, 0x03, 0xc0, 0x73, 0xce, 0x03,
0xc0, 0x73, 0xce, 0x03, 0xc0, 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00,
0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@ -1,15 +0,0 @@
#define rook_small_outline_width 32
#define rook_small_outline_height 32
static char rook_small_outline_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xc0, 0x73, 0xce, 0x03, 0x40, 0x52, 0x4a, 0x02, 0x40, 0x52, 0x4a, 0x02,
0x40, 0x52, 0x4a, 0x02, 0xc0, 0xff, 0xff, 0x03, 0x00, 0x01, 0x80, 0x00,
0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00,
0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00,
0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00,
0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00,
0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00,
0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00,
0xe0, 0xff, 0xff, 0x07, 0x20, 0x00, 0x00, 0x04, 0xe0, 0xff, 0xff, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

File diff suppressed because it is too large Load Diff

View File

@ -1,34 +0,0 @@
/*
* Scrollable Text Window Header File
*
* David Harrison
* University of California, Berkeley
* 1986
*
* This file contains definitions for a scrollable text window
* with scroll bar support.
*
* $Id: scrollText.h,v 1.2 1993/08/02 17:21:00 mycroft Exp $
*/
int TxtGrab();
/* Take hold of a previously created window */
#define TXT_NO_COLOR -1
int TxtAddFont();
/* Loads a new font for use later */
int TxtWinP();
/* Returns non-zero value if the window is text window */
int TxtClear();
/* Clears text window and resets text buffer */
int TxtWriteStr();
/* Writes a string to window with immediate update */
int TxtJamStr();
/* Write a string without causing update to screen */
int TxtRepaint();
/* Repaints entire scrollable text window */
int TxtFilter();
/* Handles events related to text window */

View File

@ -1,71 +0,0 @@
#define shade_width 80
#define shade_height 80
static char shade_bits[] = {
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
0x88, 0x88, 0x88, 0x88, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x88, 0x88,
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
0x88, 0x88, 0x88, 0x88, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x88, 0x88,
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
0x88, 0x88, 0x88, 0x88, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x88, 0x88,
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
0x88, 0x88, 0x88, 0x88, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x88, 0x88,
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
0x88, 0x88, 0x88, 0x88, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x88, 0x88,
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
0x88, 0x88, 0x88, 0x88, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x88, 0x88,
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x22, 0x22,
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
0x88, 0x88, 0x88, 0x88, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
0x44, 0x44, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x88, 0x88,
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88};

View File

@ -1,426 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
static char rcsid[] = "$Id: std.c,v 1.2 1993/08/02 17:21:01 mycroft Exp $";
#endif /* not lint */
/*
* Copyright (c) 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
*
* Utility routines.
*/
#include "std.h"
#ifndef IBMPC
#include <sys/types.h>
#endif not IBMPC
#ifdef UNIX
#include <signal.h>
#include <pwd.h>
#endif UNIX
#ifdef BSD
#include <sys/time.h>
#include <sys/resource.h>
#endif BSD
extern char **environ;
bool
prefix(p, s)
register char *p, *s;
{
while (*p && (*p == *s))
p++, s++;
if (!*p)
return (true);
else
return (false);
}
/* Create a copy of a string. */
char *
copy(str)
char *str;
{
char *p, *tmalloc();
p = tmalloc(strlen(str) + 1);
strcpy(p, str);
return(p);
}
/* Determine whether sub is a substring of str. */
bool
substring(sub, str)
register char *str, *sub;
{
register char *s;
while(*str) {
if(*str == *sub) {
for(s = sub; *s; s++)
if(*s != *str++)
break;
if(*s == '\0')
return (true);
}
str++;
}
return (false);
}
/* Malloc num bytes and initialize to zero. Fatal error if the space can't
* be malloc'd.
*/
char *
tmalloc(num)
register int num;
{
register char *s;
char *malloc();
s = malloc((unsigned) num);
if (!s) {
fatal("malloc: can't allocate %d bytes", num);
}
bzero(s, num);
return(s);
}
char *
trealloc(ptr, num)
char *ptr;
int num;
{
register char *s;
char *realloc();
s = realloc(ptr, (unsigned) num);
if (!s) {
fatal("realloc: can't allocate %d bytes", num);
}
/* Well, this won't be zeroed... Too bad... */
return(s);
}
/* Append one character to a string. Don't check for overflow. */
void
appendc(s, c)
char *s, c;
{
while (*s)
s++;
*s++ = c;
*s = '\0';
return;
}
int
scannum(str)
char *str;
{
int i = 0;
while(isdigit(*str))
i = i * 10 + *(str++) - '0';
return(i);
}
/* Case insensitive prefix. */
bool
ciprefix(p, s)
register char *p, *s;
{
while (*p) {
if ((isupper(*p) ? tolower(*p) : *p) !=
(isupper(*s) ? tolower(*s) : *s))
return(false);
p++;
s++;
}
return (true);
}
/* Case insensitive strcmp... */
bool
cieq(p, s)
register char *p, *s;
{
while (*p) {
if ((isupper(*p) ? tolower(*p) : *p) !=
(isupper(*s) ? tolower(*s) : *s))
return(false);
p++;
s++;
}
return (!*s);
}
#ifdef BSD
/* Return the date. Return value is static data. */
char *
datestring()
{
register char *tzn;
struct tm *tp;
static char tbuf[40];
char *ap;
struct timeval tv;
struct timezone tz;
char *timezone(), *asctime();
int i;
struct tm *localtime();
(void) gettimeofday(&tv, &tz);
tp = localtime((time_t *) &tv.tv_sec);
ap = asctime(tp);
tzn = timezone(tz.tz_minuteswest, tp->tm_isdst);
sprintf(tbuf, "%.20s", ap);
if (tzn)
strcat(tbuf, tzn);
strcat(tbuf, ap + 19);
i = strlen(tbuf);
tbuf[i - 1] = '\0';
return (tbuf);
}
#else BSD
/* Give it a try... */
char *
datestring()
{
long i;
static char buf[64];
i = time(0);
strcpy(buf, ctime(&i));
buf[strlen(buf) - 1] = '\0'; /* Kill the nl. */
return (buf);
}
#endif
/* How many seconds have elapsed in running time. */
int
seconds()
{
#ifdef BSD
struct rusage ruse;
getrusage(RUSAGE_SELF, &ruse);
return (ruse.ru_utime.tv_sec);
#else BSD
#endif BSD
}
/* A few things that may not exist on non-unix systems. */
#ifndef BSD
#ifndef index
char *
index(s, c)
register char *s;
register char c;
{
while ((*s != c) && (*s != '\0'))
s++;
if (*s == '\0')
return ((char *) 0);
else
return (s);
}
#endif not index
#ifndef rindex
char *
rindex(s, c)
register char *s;
register char c;
{
register char *t;
for (t = s; *t != '\0'; t++);
while ((*t != c) && (t != s))
t--;
if (t == s)
return ((char *) 0);
else
return (t);
}
#endif not rindex
#ifndef bcopy
void
bcopy(from, to, num)
register char *from, *to;
register int num;
{
while (num-- > 0)
*to++ = *from++;
return;
}
#endif not bcopy
#ifndef bzero
void
bzero(ptr, num)
register char *ptr;
register int num;
{
while (num-- > 0)
*ptr++ = '\0';
return;
}
#endif not bzero
/* This might not be around... If not then forget about sorting... */
void qsort() {}
#endif BSD
char *
gettok(s)
char **s;
{
char buf[BSIZE];
int i = 0;
while (isspace(**s))
(*s)++;
if (!**s)
return (NULL);
while (**s && !isspace(**s))
buf[i++] = *(*s)++;
buf[i] = '\0';
while (isspace(**s))
(*s)++;
return (copy(buf));
}
/* Die horribly. */
/* VARARGS1 */
void
fatal(s, args)
char *s;
{
fputs("Internal Error: ", stderr);
_doprnt(s, &args, stderr);
putc('\n', stderr);
kill(getpid(), SIGIOT);
/* NOTREACHED */
}
void
setenv(name, value)
char *name, *value;
{
int i;
char **xx, *s;
s = tmalloc(strlen(name) + 2);
sprintf(s, "%s=", name);
/* Copy the old environment... */
for (i = 0; environ[i]; i++)
if (prefix(s, environ[i]))
break;
if (!environ[i]) {
xx = (char **) tmalloc((i + 2) * sizeof (char *));
for (i = 0; environ[i]; i++)
xx[i] = environ[i];
xx[i + 1] = NULL;
environ = xx;
} else
xx = environ;
xx[i] = tmalloc(strlen(name) + strlen(value) + 2);
sprintf(xx[i], "%s=%s", name, value);
return;
}
char *
getusername()
{
int i = getuid();
struct passwd *pw = getpwuid(i);
return (pw ? pw->pw_name : NULL);
}
char *
gethome()
{
int i = getuid();
struct passwd *pw = getpwuid(i);
return (pw ? pw->pw_dir : "/strange");
}
char *
tildexpand(s)
char *s;
{
struct passwd *pw;
char *n, buf[64];
int i;
if (*s != '~')
return (copy(s));
for (s++, i = 0; *s != '/'; s++, i++)
buf[i] = *s;
buf[i] = '\0';
if (!i)
pw = getpwuid(getuid());
else
pw = getpwnam(buf);
if (!pw)
return (s);
n = tmalloc(strlen(s) + strlen(pw->pw_dir) + 1);
strcpy(n, pw->pw_dir);
strcat(n, s);
return (n);
}

View File

@ -1,106 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies.
$Id: std.h,v 1.2 1993/08/02 17:21:02 mycroft Exp $
*/
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
*
* Standard definitions.
*/
#define UNIX
#define BSD
#ifndef FILE
#include <stdio.h>
#endif
#ifndef isalpha
#include <ctype.h>
#endif
#ifndef HUGE
#include <math.h>
#endif
#include <strings.h>
typedef int bool;
#define false 0
#define true 1
/* Externs defined in std.c */
extern char *tmalloc();
extern char *trealloc();
extern char *copy();
extern char *datestring();
extern char *getusername();
extern char *gethome();
extern char *gettok();
extern char *tildexpand();
extern void fatal();
extern void setenv();
extern void appendc();
extern int scannum();
extern int seconds();
extern bool prefix();
extern bool ciprefix();
extern bool cieq();
extern bool substring();
/* Externs from libc */
extern char *getenv();
extern int errno;
extern char *sys_errlist[];
/* Should use BSIZE instead of BUFSIZ... */
#define BSIZE 512
/* Some standard macros. */
#define eq(a,b) (!strcmp((a), (b)))
#define isalphanum(c) (isalpha(c) || isdigit(c))
#define alloc(strname) ((struct strname *) tmalloc(sizeof(struct strname)))
#define tfree(ptr) { if (ptr) free((char *) ptr); ptr = 0; }
#define hexnum(c) ((((c) >= '0') && ((c) <= '9')) ? ((c) - '0') : ((((c) >= \
'a') && ((c) <= 'f')) ? ((c) - 'a' + 10) : ((((c) >= 'A') && \
((c) <= 'F')) ? ((c) - 'A' + 10) : 0)))
#ifndef BSD
#define random rand
#define srandom srand
#endif BSD
#ifdef VMS
#define EXIT_NORMAL 1
#define EXIT_BAD 0
#else VMS
#define EXIT_NORMAL 0
#define EXIT_BAD 1
#endif VMS

View File

@ -1,265 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
static char rcsid[] = "$Id: valid.c,v 1.2 1993/08/02 17:21:03 mycroft Exp $";
#endif /* not lint */
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*
* Validate a move.
*/
#include "xchess.h"
extern bool ischeck(), couldmove();
bool
valid_move(m, b)
move *m;
board *b;
{
board tb;
/* First check that the piece can make the move at all... */
if (!couldmove(m, b))
return (false);
/* Now see if the king is in check now. */
bcopy((char *) b, (char *) &tb, sizeof (board));
board_move(&tb, m);
if (ischeck(&tb, m->piece.color))
return (false);
if (ischeck(&tb, ((m->piece.color == WHITE) ? BLACK : WHITE)))
m->check = true;
return (true);
}
static bool
couldmove(m, b)
move *m;
board *b;
{
int x, y;
switch (m->type) {
case KCASTLE:
if ((m->piece.color == WHITE) && (b->white_cant_castle_k) ||
(m->piece.color == BLACK) &&
(b->black_cant_castle_k))
return (false);
if ((b->square[m->fromy][5].color != NONE) ||
(b->square[m->fromy][6].color != NONE))
return (false);
if (ischeck(b, m->piece.color))
return (false);
break;
case QCASTLE:
if ((m->piece.color == WHITE) && (b->white_cant_castle_q) ||
(m->piece.color == BLACK) &&
(b->black_cant_castle_q))
return (false);
if ((b->square[m->fromy][1].color != NONE) ||
(b->square[m->fromy][2].color != NONE) ||
(b->square[m->fromy][3].color != NONE))
return (false);
if (ischeck(b, m->piece.color))
return (false);
break;
case MOVE:
case CAPTURE:
/* There is one special case here, that of taking a pawn
* en passant. In this case we change the move field to
* CAPTURE if it's ok.
*/
switch (m->piece.type) {
case PAWN:
if ((m->type == MOVE) && (m->fromx == m->tox)) {
/* A normal move. */
if ((m->piece.color == WHITE) && (m->fromy ==
m->toy + 1))
break;
if ((m->piece.color == WHITE) && (m->fromy ==
6) && (m->toy == 4) &&
(b->square[5][m->fromx].color
== NONE))
break;
if ((m->piece.color == BLACK) && (m->fromy ==
m->toy - 1))
break;
if ((m->piece.color == BLACK) && (m->fromy ==
1) && (m->toy == 3) &&
(b->square[2][m->fromx].color
== NONE))
break;
return (false);
} else if (m->type == CAPTURE) {
if ((((m->piece.color == WHITE) && (m->fromy ==
m->toy + 1)) || ((m->piece.color ==
BLACK) && (m->fromy == m->toy -
1))) && ((m->fromx == m->tox + 1) ||
(m->fromx == m->tox - 1)))
break;
/* Now maybe it's enpassant... We've already
* checked for some of these things in the
* calling routine.
*/
if (m->enpassant) {
if (b->square[(m->piece.color == WHITE)
? 3 : 4][m->tox].color ==
((m->piece.color == WHITE) ?
BLACK : WHITE))
break;
}
return (false);
}
return (false);
case ROOK:
if (m->fromx == m->tox) {
for (y = m->fromy + ((m->fromy > m->toy) ? -1 :
1); y != m->toy; y += ((m->fromy
> m->toy) ? -1 : 1))
if (b->square[y][m->tox].color != NONE)
return (false);
break;
}
if (m->fromy == m->toy) {
for (x = m->fromx + ((m->fromx > m->tox) ? -1 :
1); x != m->tox; x += ((m->fromx
> m->tox) ? -1 : 1))
if (b->square[m->toy][x].color != NONE)
return (false);
break;
}
return (false);
case KNIGHT:
x = m->fromx - m->tox;
y = m->fromy - m->toy;
if ((((x == 2) || (x == -2)) &&
((y == 1) || (y == -1))) ||
(((x == 1) || (x == -1)) &&
((y == 2) || (y == -2))))
break;
return (false);
case BISHOP:
x = m->fromx - m->tox;
y = m->fromy - m->toy;
if ((x != y) && (x != - y))
return (false);
for (x = m->fromx + ((m->fromx > m->tox) ? -1 : 1), y =
m->fromy + ((m->fromy > m->toy) ? -1 :
1); x != m->tox;
x += ((m->fromx > m->tox) ? -1 : 1),
y += ((m->fromy > m->toy) ? -1 : 1))
if (b->square[y][x].color != NONE)
return (false);
break;
case QUEEN:
if (m->fromx == m->tox) {
for (y = m->fromy + ((m->fromy > m->toy) ? -1 :
1); y != m->toy; y += ((m->fromy
> m->toy) ? -1 : 1))
if (b->square[y][m->tox].color != NONE)
return (false);
break;
}
if (m->fromy == m->toy) {
for (x = m->fromx + ((m->fromx > m->tox) ? -1 :
1); x != m->tox; x += ((m->fromx
> m->tox) ? -1 : 1))
if (b->square[m->toy][x].color != NONE)
return (false);
break;
}
x = m->fromx - m->tox;
y = m->fromy - m->toy;
if ((x != y) && (x != - y))
return (false);
for (x = m->fromx + ((m->fromx > m->tox) ? -1 : 1), y =
m->fromy + ((m->fromy > m->toy) ? -1 :
1); x != m->tox;
x += ((m->fromx > m->tox) ? -1 : 1),
y += ((m->fromy > m->toy) ? -1 : 1))
if (b->square[y][x].color != NONE)
return (false);
break;
case KING:
x = m->fromx - m->tox;
y = m->fromy - m->toy;
if ((x >= -1) && (x <= 1) && (y >= -1) && (y <= 1))
break;
return (false);
}
break;
}
return (true);
}
/* Say whether either king is in check... If move is non-NULL, say whether he
* in in check after the move takes place. We do this in a rather stupid way.
*/
static bool
ischeck(b, col)
board *b;
color col;
{
int x, y, kx, ky;
move ch;
for (x = 0; x < SIZE; x++)
for (y = 0; y < SIZE; y++)
if ((b->square[y][x].color == col) &&
(b->square[y][x].type == KING)) {
kx = x;
ky = y;
}
for (x = 0; x < SIZE; x++)
for (y = 0; y < SIZE; y++)
if (b->square[y][x].color == ((col == WHITE) ?
BLACK : WHITE)) {
ch.type = CAPTURE;
ch.piece.color = b->square[y][x].color;
ch.piece.type = b->square[y][x].type;
ch.fromx = x;
ch.fromy = y;
ch.tox = kx;
ch.toy = ky;
ch.enpassant = false;
if (couldmove(&ch, b))
return (true);
}
return (false);
}

View File

@ -1,954 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
static char rcsid[] = "$Id: window.c,v 1.2 1993/08/02 17:21:05 mycroft Exp $";
#endif /* not lint */
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*
* Deal with the two (or one) windows.
*/
#include "xchess.h"
#include <X11/Xutil.h>
#include <sys/time.h>
#include "pawn.bitmap"
#include "rook.bitmap"
#include "knight.bitmap"
#include "bishop.bitmap"
#include "queen.bitmap"
#include "king.bitmap"
#include "pawn_outline.bitmap"
#include "rook_outline.bitmap"
#include "knight_outline.bitmap"
#include "bishop_outline.bitmap"
#include "queen_outline.bitmap"
#include "king_outline.bitmap"
#include "pawn_mask.bitmap"
#include "rook_mask.bitmap"
#include "knight_mask.bitmap"
#include "bishop_mask.bitmap"
#include "queen_mask.bitmap"
#include "king_mask.bitmap"
#include "shade.bitmap"
#include "xchess.cur"
#include "xchess_mask.cur"
#include "xchess.icon"
windata *win1, *win2;
bool win_flashmove = false;
extern bool setup();
extern void service(), drawgrid(), icon_refresh();
bool
win_setup(disp1, disp2)
char *disp1, *disp2;
{
win1 = alloc(windata);
if (!oneboard)
win2 = alloc(windata);
if (!setup(disp1, win1) || (!oneboard && !setup(disp2, win2)))
return (false);
if (blackflag) {
win1->color = BLACK;
win1->flipped = true;
} else
win1->color = WHITE;
win_drawboard(win1);
if (!oneboard) {
win2->color = BLACK;
win2->flipped = true;
win_drawboard(win2);
}
return(true);
}
/* Draw the chess board... */
void
win_drawboard(win)
windata *win;
{
int i, j;
drawgrid(win);
/* Now toss on the squares... */
for (i = 0; i < SIZE; i++)
for (j = 0; j < SIZE; j++)
win_erasepiece(j, i, win->color);
return;
}
/* Draw one piece. */
void
win_drawpiece(p, y, x, wnum)
piece *p;
int y, x;
color wnum;
{
char *bits, *maskbits, *outline;
windata *win;
char buf[BSIZE];
XImage *tmpImage;
Pixmap tmpPM, maskPM;
XGCValues gc;
if (oneboard || (wnum == win1->color))
win = win1;
else
win = win2;
if (win->flipped) {
y = SIZE - y - 1;
x = SIZE - x - 1;
}
/*
if (debug)
fprintf(stderr, "draw a %s at (%d, %d) on board %d\n",
piecenames[(int) p->type], y, x, wnum);
*/
if ((x < 0) || (x > 7) || (y < 0) || (y > 7)) exit(1);
switch (p->type) {
case PAWN:
bits = pawn_bits;
maskbits = pawn_mask_bits;
outline = pawn_outline_bits;
break;
case ROOK:
bits = rook_bits;
maskbits = rook_mask_bits;
outline = rook_outline_bits;
break;
case KNIGHT:
bits = knight_bits;
maskbits = knight_mask_bits;
outline = knight_outline_bits;
break;
case BISHOP:
bits = bishop_bits;
maskbits = bishop_mask_bits;
outline = bishop_outline_bits;
break;
case QUEEN:
bits = queen_bits;
maskbits = queen_mask_bits;
outline = queen_outline_bits;
break;
case KING:
bits = king_bits;
maskbits = king_mask_bits;
outline = king_outline_bits;
break;
default:
fprintf(stderr,
"Internal Error: win_drawpiece: bad piece type %d\n",
p->type);
}
/* There are two things we can do... If this is a black and white
* display, we have to shade the square and use an outline if the piece
* is white. We also have to use a mask... Since we don't want
* to use up too many bitmaps, create the mask bitmap, put the bits,
* and then destroy it.
*/
if (win->bnw && (p->color == WHITE))
bits = outline;
if (win->bnw && !iswhite(win, x, y)) {
XSetState(win->display, DefaultGC(win->display, 0),
BlackPixel(win->display, 0),
WhitePixel(win->display, 0), GXcopy, AllPlanes);
tmpPM = XCreateBitmapFromData(win->display, win->boardwin,
shade_bits, SQUARE_WIDTH, SQUARE_HEIGHT);
XCopyPlane(win->display, tmpPM, win->boardwin, DefaultGC(win->display, 0),
0, 0, SQUARE_WIDTH, SQUARE_HEIGHT,
x * (SQUARE_WIDTH + BORDER_WIDTH),
y * (SQUARE_HEIGHT + BORDER_WIDTH), 1);
XFreePixmap(win->display, tmpPM);
XSetFunction(win->display, DefaultGC(win->display, 0),
GXandInverted);
maskPM = XCreateBitmapFromData(win->display, win->boardwin,
maskbits, SQUARE_WIDTH, SQUARE_HEIGHT);
XCopyPlane(win->display, maskPM, win->boardwin, DefaultGC(win->display, 0),
0, 0, SQUARE_WIDTH, SQUARE_HEIGHT,
x * (SQUARE_WIDTH + BORDER_WIDTH),
y * (SQUARE_HEIGHT + BORDER_WIDTH), 1);
XFreePixmap(win->display, maskPM);
XSetFunction(win->display, DefaultGC(win->display, 0),
GXor);
tmpPM = XCreateBitmapFromData(win->display, win->boardwin,
bits, SQUARE_WIDTH, SQUARE_HEIGHT);
XCopyPlane(win->display, tmpPM, win->boardwin, DefaultGC(win->display, 0),
0, 0, SQUARE_WIDTH, SQUARE_HEIGHT,
x * (SQUARE_WIDTH + BORDER_WIDTH),
y * (SQUARE_HEIGHT + BORDER_WIDTH), 1);
XFreePixmap(win->display, tmpPM);
XSetFunction(win->display, DefaultGC(win->display, 0), GXcopy);
} else if (win->bnw){
XSetState(win->display, DefaultGC(win->display, 0),
BlackPixel(win->display, 0),
WhitePixel(win->display, 0), GXcopy, AllPlanes);
tmpPM = XCreateBitmapFromData(win->display, win->boardwin,
bits, SQUARE_WIDTH, SQUARE_HEIGHT);
XCopyPlane(win->display, tmpPM, win->boardwin, DefaultGC(win->display, 0),
0, 0, SQUARE_WIDTH, SQUARE_HEIGHT,
x * (SQUARE_WIDTH + BORDER_WIDTH),
y * (SQUARE_HEIGHT + BORDER_WIDTH), 1);
XFreePixmap(win->display, tmpPM);
} else {
XSetState(win->display, DefaultGC(win->display, 0),
((p->color == WHITE) ? win->whitepiece.pixel :
win->blackpiece.pixel),
(iswhite(win, x, y) ? win->whitesquare.pixel :
win->blacksquare.pixel),
GXcopy, AllPlanes);
tmpPM = XCreateBitmapFromData(win->display, win->boardwin,
bits, SQUARE_WIDTH, SQUARE_HEIGHT);
XCopyPlane(win->display, tmpPM, win->boardwin, DefaultGC(win->display, 0),
0, 0, SQUARE_WIDTH, SQUARE_HEIGHT,
x * (SQUARE_WIDTH + BORDER_WIDTH),
y * (SQUARE_HEIGHT + BORDER_WIDTH), 1);
XFreePixmap(win->display, tmpPM);
}
if (!record_english) {
gc.foreground = win->textcolor.pixel;
if (iswhite(win, x, y) || win->bnw)
gc.background = win->whitesquare.pixel;
else
gc.background = win->blacksquare.pixel;
gc.font = win->small->fid;
XChangeGC(win->display, DefaultGC(win->display, 0),
GCForeground | GCBackground | GCFont, &gc);
if (!x) {
sprintf(buf, " %d", SIZE - y);
XDrawImageString(win->display, win->boardwin,
DefaultGC(win->display, 0),
1, (y + 1) * (SQUARE_HEIGHT +
BORDER_WIDTH) - BORDER_WIDTH +
win->small->max_bounds.ascent - 1, buf, 2);
}
if (y == SIZE - 1) {
sprintf(buf, "%c", 'A' + x);
XDrawImageString(win->display, win->boardwin,
DefaultGC(win->display, 0),
x * (SQUARE_WIDTH + BORDER_WIDTH) + 1,
SIZE * (SQUARE_HEIGHT + BORDER_WIDTH) - BORDER_WIDTH +
win->small->max_bounds.ascent - 1, buf, 1);
}
}
return;
}
void
win_erasepiece(y, x, wnum)
int y, x;
color wnum;
{
windata *win;
char buf[BSIZE];
XGCValues gc;
Pixmap tmpPM;
if (oneboard || (wnum == win1->color))
win = win1;
else
win = win2;
if (win->flipped) {
y = SIZE - y - 1;
x = SIZE - x - 1;
}
/*
if (debug)
fprintf(stderr, "erase square (%d, %d) on board %d\n", y, x,
wnum);
*/
if ((x < 0) || (x > 7) || (y < 0) || (y > 7)) exit(1);
if (win->bnw && !iswhite(win, x, y)) {
XSetState(win->display, DefaultGC(win->display, 0),
BlackPixel(win->display, 0),
WhitePixel(win->display, 0), GXcopy, AllPlanes);
tmpPM = XCreateBitmapFromData(win->display, win->boardwin,
shade_bits, SQUARE_WIDTH, SQUARE_HEIGHT);
XCopyPlane(win->display, tmpPM, win->boardwin, DefaultGC(win->display, 0),
0, 0, SQUARE_WIDTH, SQUARE_HEIGHT,
x * (SQUARE_WIDTH + BORDER_WIDTH),
y * (SQUARE_HEIGHT + BORDER_WIDTH), 1);
XFreePixmap(win->display, tmpPM);
} else {
XSetFillStyle(win->display, DefaultGC(win->display, 0),
FillSolid);
XSetForeground(win->display, DefaultGC(win->display, 0),
iswhite(win, x, y) ? win->whitesquare.pixel :
win->blacksquare.pixel);
XFillRectangle(win->display, win->boardwin,
DefaultGC(win->display, 0),
x * (SQUARE_WIDTH + BORDER_WIDTH),
y * (SQUARE_HEIGHT + BORDER_WIDTH),
SQUARE_WIDTH, SQUARE_HEIGHT);
}
if (!record_english) {
gc.foreground = win->textcolor.pixel;
if (iswhite(win, x, y) || win->bnw)
gc.background = win->whitesquare.pixel;
else
gc.background = win->blacksquare.pixel;
gc.font = win->small->fid;
XChangeGC(win->display, DefaultGC(win->display, 0),
GCForeground | GCBackground | GCFont, &gc);
if (!x) {
sprintf(buf, " %d", SIZE - y);
XDrawImageString(win->display, win->boardwin,
DefaultGC(win->display, 0),
1, (y + 1) * (SQUARE_HEIGHT +
BORDER_WIDTH) - BORDER_WIDTH +
win->small->max_bounds.ascent - 1, buf, 2);
}
if (y == SIZE - 1) {
sprintf(buf, "%c", 'A' + x);
XDrawImageString(win->display, win->boardwin,
DefaultGC(win->display, 0),
x * (SQUARE_WIDTH + BORDER_WIDTH) + 1,
SIZE * (SQUARE_HEIGHT + BORDER_WIDTH) - BORDER_WIDTH +
win->small->max_bounds.ascent - 1, buf, 1);
}
}
return;
}
void
win_flash(m, wnum)
move *m;
color wnum;
{
windata *win;
int sx, sy, ex, ey, i;
if (oneboard || (wnum == win1->color))
win = win1;
else
win = win2;
if (win->flipped) {
sx = SIZE - m->fromx - 1;
sy = SIZE - m->fromy - 1;
ex = SIZE - m->tox - 1;
ey = SIZE - m->toy - 1;
} else {
sx = m->fromx;
sy = m->fromy;
ex = m->tox;
ey = m->toy;
}
sx = sx * (SQUARE_WIDTH + BORDER_WIDTH) + SQUARE_WIDTH / 2;
sy = sy * (SQUARE_HEIGHT + BORDER_WIDTH) + SQUARE_HEIGHT / 2;
ex = ex * (SQUARE_WIDTH + BORDER_WIDTH) + SQUARE_WIDTH / 2;
ey = ey * (SQUARE_HEIGHT + BORDER_WIDTH) + SQUARE_HEIGHT / 2;
XSetFunction(win->display, DefaultGC(win->display, 0), GXinvert);
XSetLineAttributes(win->display, DefaultGC(win->display, 0),
0, LineSolid, 0, 0);
for (i = 0; i < num_flashes * 2; i++) {
XDrawLine(win->display,win->boardwin,
DefaultGC(win->display, 0),
sx, sy, ex, ey);
}
XSetFunction(win->display, DefaultGC(win->display, 0), GXcopy);
return;
}
/* Handle input from the players. */
void
win_process(quick)
bool quick;
{
int i, rfd = 0, wfd = 0, xfd = 0;
struct timeval timeout;
timeout.tv_sec = 0;
timeout.tv_usec = (quick ? 0 : 500000);
if (XPending(win1->display))
service(win1);
if (!oneboard) {
if (XPending(win1->display))
service(win2);
}
if (oneboard)
rfd = 1 << win1->display->fd;
else
rfd = (1 << win1->display->fd) | (1 << win2->display->fd);
if (!(i = select(32, &rfd, &wfd, &xfd, &timeout)))
return;
if (i == -1) {
perror("select");
exit(1);
}
if (rfd & (1 << win1->display->fd))
service(win1);
if (!oneboard && (rfd & (1 << win2->display->fd)))
service(win2);
return;
}
static void
service(win)
windata *win;
{
XEvent ev;
while(XPending(win->display)) {
XNextEvent(win->display, &ev);
if (TxtFilter(win->display, &ev))
continue;
if (ev.xany.window == win->boardwin) {
switch (ev.type) {
case ButtonPress:
button_pressed(&ev, win);
break;
case ButtonRelease:
button_released(&ev, win);
break;
case Expose:
/* Redraw... */
win_redraw(win, &ev);
break;
case 0:
case NoExpose:
break;
default:
fprintf(stderr, "Bad event type %d\n", ev.type);
exit(1);
}
} else if (ev.xany.window == win->wclockwin) {
switch (ev.type) {
case Expose:
clock_draw(win, WHITE);
break;
case 0:
case NoExpose:
break;
default:
fprintf(stderr, "Bad event type %d\n", ev.type);
exit(1);
}
} else if (ev.xany.window == win->bclockwin) {
switch (ev.type) {
case Expose:
clock_draw(win, BLACK);
break;
case 0:
case NoExpose:
break;
default:
fprintf(stderr, "Bad event type %d\n", ev.type);
exit(1);
}
} else if (ev.xany.window == win->jailwin) {
switch (ev.type) {
case Expose:
jail_draw(win);
break;
case 0:
case NoExpose:
break;
default:
fprintf(stderr, "Bad event type %d\n", ev.type);
exit(1);
}
} else if (ev.xany.window == win->buttonwin) {
switch (ev.type) {
case ButtonPress:
button_service(win, &ev);
break;
case Expose:
button_draw(win);
break;
case 0:
case NoExpose:
break;
default:
fprintf(stderr, "Bad event type %d\n", ev.type);
exit(1);
}
} else if (ev.xany.window == win->icon) {
icon_refresh(win);
} else if (ev.xany.window == win->basewin) {
message_send(win, &ev);
} else {
fprintf(stderr, "Internal Error: service: bad win\n");
fprintf(stderr, "window = %d, event = %d\n", ev.xany.window,
ev.type);
}
}
return;
}
void
win_redraw(win, event)
windata *win;
XEvent *event;
{
XExposeEvent *ev = &event->xexpose;
int x1, y1, x2, y2, i, j;
drawgrid(win);
if (ev) {
x1 = ev->x / (SQUARE_WIDTH + BORDER_WIDTH);
y1 = ev->y / (SQUARE_HEIGHT + BORDER_WIDTH);
x2 = (ev->x + ev->width) / (SQUARE_WIDTH + BORDER_WIDTH);
y2 = (ev->y + ev->height) / (SQUARE_HEIGHT + BORDER_WIDTH);
} else {
x1 = 0;
y1 = 0;
x2 = SIZE - 1;
y2 = SIZE - 1;
}
if (x1 < 0) x1 = 0;
if (y1 < 0) y1 = 0;
if (x2 < 0) x2 = 0;
if (y2 < 0) y2 = 0;
if (x1 > SIZE - 1) x1 = SIZE - 1;
if (y1 > SIZE - 1) y1 = SIZE - 1;
if (x2 > SIZE - 1) x2 = SIZE - 1;
if (y2 > SIZE - 1) y2 = SIZE - 1;
if (win->flipped) {
y1 = SIZE - y2 - 1;
y2 = SIZE - y1 - 1;
x1 = SIZE - x2 - 1;
x2 = SIZE - x1 - 1;
}
for (i = x1; i <= x2; i++)
for (j = y1; j <= y2; j++) {
if (chessboard->square[j][i].color == NONE)
win_erasepiece(j, i, WHITE);
else
win_drawpiece(&chessboard->square[j][i], j, i,
WHITE);
if (!oneboard) {
if (chessboard->square[j][i].color == NONE)
win_erasepiece(j, i, BLACK);
else
win_drawpiece(&chessboard->square[j][i],
j, i, BLACK);
}
}
return;
}
static bool
setup(dispname, win)
char *dispname;
windata *win;
{
char buf[BSIZE], *s;
Pixmap bm, bmask;
Cursor cur;
extern char *program, *recfile;
XSizeHints xsizes;
if (!(win->display = XOpenDisplay(dispname)))
return (false);
/* Now get boolean defaults... */
if ((s = XGetDefault(win->display, program, "noisy")) && eq(s, "on"))
noisyflag = true;
if ((s = XGetDefault(win->display, program, "savemoves")) && eq(s, "on"))
saveflag = true;
if ((s = XGetDefault(win->display, program, "algebraic")) && eq(s, "on"))
record_english = false;
if ((s = XGetDefault(win->display, program, "blackandwhite")) && eq(s, "on"))
bnwflag = true;
if ((s = XGetDefault(win->display, program, "quickrestore")) && eq(s, "on"))
quickflag = true;
if ((s = XGetDefault(win->display, program, "flash")) && eq(s, "on"))
win_flashmove = true;
/* ... numeric variables ... */
if (s = XGetDefault(win->display, program, "numflashes"))
num_flashes = atoi(s);
if (s = XGetDefault(win->display, program, "flashsize"))
flash_size = atoi(s);
/* ... and strings. */
if (s = XGetDefault(win->display, program, "progname"))
progname = s;
if (s = XGetDefault(win->display, program, "proghost"))
proghost = s;
if (s = XGetDefault(win->display, program, "recordfile"))
recfile = s;
if (s = XGetDefault(win->display, program, "blackpiece"))
black_piece_color = s;
if (s = XGetDefault(win->display, program, "whitepiece"))
white_piece_color = s;
if (s = XGetDefault(win->display, program, "blacksquare"))
black_square_color = s;
if (s = XGetDefault(win->display, program, "whitesquare"))
white_square_color = s;
if (s = XGetDefault(win->display, program, "bordercolor"))
border_color = s;
if (s = XGetDefault(win->display, program, "textcolor"))
text_color = s;
if (s = XGetDefault(win->display, program, "textback"))
text_back = s;
if (s = XGetDefault(win->display, program, "errortext"))
error_text = s;
if (s = XGetDefault(win->display, program, "playertext"))
player_text = s;
if (s = XGetDefault(win->display, program, "cursorcolor"))
cursor_color = s;
if ((DisplayPlanes(win->display, 0) == 1) || bnwflag)
win->bnw = true;
/* Allocate colors... */
if (win->bnw) {
win->blackpiece.pixel = BlackPixel (win->display, 0);
win->whitepiece.pixel = WhitePixel (win->display, 0);
win->blacksquare.pixel = BlackPixel (win->display, 0);
win->whitesquare.pixel = WhitePixel (win->display, 0);
win->border.pixel = BlackPixel (win->display, 0);
win->textcolor.pixel = BlackPixel (win->display, 0);
win->textback.pixel = WhitePixel (win->display, 0);
win->playertext.pixel = BlackPixel (win->display, 0);
win->errortext.pixel = BlackPixel (win->display, 0);
win->cursorcolor.pixel = BlackPixel (win->display, 0) ;
} else {
if (!XParseColor(win->display,
DefaultColormap(win->display, 0),
black_piece_color, &win->blackpiece) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
white_piece_color, &win->whitepiece) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
black_square_color, &win->blacksquare) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
white_square_color, &win->whitesquare) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
border_color, &win->border) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
text_color, &win->textcolor) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
text_back, &win->textback) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
error_text, &win->errortext) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
player_text, &win->playertext) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
cursor_color, &win->cursorcolor) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->blackpiece) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->whitepiece) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->blacksquare) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->whitesquare) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->border) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->textcolor) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->textback) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->errortext) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->playertext) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->cursorcolor))
fprintf(stderr, "Can't get colors...\n");
}
/* Get fonts... */
if ((win->small = XLoadQueryFont(win->display,SMALL_FONT)) ==
NULL)
fprintf(stderr, "Can't get small font...\n");
if ((win->medium = XLoadQueryFont(win->display,MEDIUM_FONT))
== NULL)
fprintf(stderr, "Can't get medium font...\n");
if ((win->large = XLoadQueryFont(win->display,LARGE_FONT)) ==
NULL)
fprintf(stderr, "Can't get large font...\n");
/* Create the windows... */
win->basewin =
XCreateSimpleWindow(win->display,DefaultRootWindow(win->display),
BASE_XPOS, BASE_YPOS,
BASE_WIDTH, BASE_HEIGHT, 0,
BlackPixel(win->display, 0),
WhitePixel(win->display, 0));
win->boardwin = XCreateSimpleWindow(win->display,win->basewin,
BOARD_XPOS, BOARD_YPOS,
BOARD_WIDTH, BOARD_HEIGHT,
BORDER_WIDTH,
win->border.pixel,
WhitePixel(win->display, 0));
win->recwin = XCreateSimpleWindow(win->display,win->basewin,
RECORD_XPOS, RECORD_YPOS,
RECORD_WIDTH, RECORD_HEIGHT,
BORDER_WIDTH, win->border.pixel,
win->textback.pixel);
win->jailwin = XCreateSimpleWindow(win->display,win->basewin,
JAIL_XPOS, JAIL_YPOS,
JAIL_WIDTH, JAIL_HEIGHT,
BORDER_WIDTH,
win->border.pixel,
win->textback.pixel);
win->wclockwin = XCreateSimpleWindow(win->display,win->basewin,
WCLOCK_XPOS, WCLOCK_YPOS,
CLOCK_WIDTH, CLOCK_HEIGHT,
BORDER_WIDTH, win->border.pixel,
win->textback.pixel);
win->bclockwin = XCreateSimpleWindow(win->display,win->basewin,
BCLOCK_XPOS, BCLOCK_YPOS,
CLOCK_WIDTH, CLOCK_HEIGHT,
BORDER_WIDTH, win->border.pixel,
win->textback.pixel);
win->messagewin = XCreateSimpleWindow(win->display,win->basewin,
MESS_XPOS, MESS_YPOS,
MESS_WIDTH, MESS_HEIGHT,
BORDER_WIDTH, win->border.pixel,
win->textback.pixel);
win->buttonwin = XCreateSimpleWindow(win->display,win->basewin,
BUTTON_XPOS, BUTTON_YPOS,
BUTTON_WIDTH, BUTTON_HEIGHT,
BORDER_WIDTH, win->border.pixel,
win->textback.pixel);
/* Let's define an icon... */
win->iconpixmap = XCreatePixmapFromBitmapData(win->display,
win->basewin, icon_bits,
icon_width, icon_height,
win->blacksquare.pixel,
win->whitesquare.pixel,
1);
xsizes.flags = PSize | PMinSize | PPosition;
xsizes.min_width = BASE_WIDTH;
xsizes.min_height = BASE_HEIGHT;
xsizes.x = BASE_XPOS;
xsizes.y = BASE_YPOS;
XSetStandardProperties(win->display, win->basewin,
program, program, win->iconpixmap,
0, NULL, &xsizes);
bm = XCreateBitmapFromData(win->display,
win->basewin, xchess_bits,
xchess_width, xchess_height);
bmask = XCreateBitmapFromData(win->display,
win->basewin, xchess_mask_bits,
xchess_width, xchess_height);
cur = XCreatePixmapCursor(win->display, bm, bmask,
&win->cursorcolor,
&WhitePixel(win->display, 0),
xchess_x_hot, xchess_y_hot);
XFreePixmap(win->display, bm);
XFreePixmap(win->display, bmask);
XDefineCursor(win->display,win->basewin, cur);
XMapSubwindows(win->display,win->basewin);
XMapRaised(win->display,win->basewin);
XSelectInput(win->display,win->basewin, KeyPressMask);
XSelectInput(win->display,win->boardwin,
ButtonPressMask | ButtonReleaseMask | ExposureMask);
XSelectInput(win->display,win->recwin,
ButtonReleaseMask | ExposureMask);
XSelectInput(win->display,win->jailwin, ExposureMask);
XSelectInput(win->display,win->wclockwin, ExposureMask);
XSelectInput(win->display,win->bclockwin, ExposureMask);
XSelectInput(win->display,win->messagewin,
ButtonReleaseMask | ExposureMask);
XSelectInput(win->display,win->buttonwin,
ButtonPressMask | ExposureMask);
message_init(win);
record_init(win);
button_draw(win);
jail_init(win);
clock_init(win, WHITE);
clock_init(win, BLACK);
if (timeunit) {
if (timeunit > 1800)
sprintf(buf, "%d moves every %.2lg hours.\n",
movesperunit, ((double) timeunit) / 3600);
else if (timeunit > 30)
sprintf(buf, "%d moves every %.2lg minutes.\n",
movesperunit, ((double) timeunit) / 60);
else
sprintf(buf, "%d moves every %d seconds.\n",
movesperunit, timeunit);
message_add(win, buf, false);
}
return (true);
}
static void
drawgrid(win)
windata *win;
{
int i;
XGCValues gc;
gc.function = GXcopy;
gc.plane_mask = AllPlanes;
gc.foreground = win->border.pixel;
gc.line_width = 0;
gc.line_style = LineSolid;
XChangeGC(win->display,
DefaultGC(win->display, 0),
GCFunction | GCPlaneMask | GCForeground |
GCLineWidth | GCLineStyle, &gc);
/* Draw the lines... horizontal, */
for (i = 1; i < SIZE; i++)
XDrawLine(win->display, win->boardwin,
DefaultGC(win->display, 0), 0,
i * (SQUARE_WIDTH + BORDER_WIDTH) -
BORDER_WIDTH / 2,
SIZE * (SQUARE_WIDTH + BORDER_WIDTH),
i * (SQUARE_WIDTH + BORDER_WIDTH) -
BORDER_WIDTH / 2);
/* and vertical... */
for (i = 1; i < SIZE; i++)
XDrawLine(win->display, win->boardwin,
DefaultGC(win->display, 0),
i * (SQUARE_WIDTH + BORDER_WIDTH) -
BORDER_WIDTH / 2, 0,
i * (SQUARE_WIDTH + BORDER_WIDTH) -
BORDER_WIDTH / 2,
SIZE * (SQUARE_WIDTH + BORDER_WIDTH));
return;
}
void
win_restart()
{
win1->flipped = false;
win_redraw(win1, (XEvent *) NULL);
if (!oneboard) {
win2->flipped = true;
win_redraw(win2, (XEvent *) NULL);
}
return;
}
static void
icon_refresh(win)
windata *win;
{
XCopyArea(win->display, win->iconpixmap, win->icon,
DefaultGC(win->display, 0),
0, 0, icon_width, icon_height, 0, 0);
return;
}

View File

@ -1,928 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/03/21 09:45:37 $
* $Source: /cvsroot/src/gnu/games/chess/Xchess/Attic/window.c.bm,v $
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*
* Deal with the two (or one) windows.
*/
#include "xchess.h"
#include <sys/time.h>
#include "pawn.bitmap"
#include "rook.bitmap"
#include "knight.bitmap"
#include "bishop.bitmap"
#include "queen.bitmap"
#include "king.bitmap"
#include "pawn_outline.bitmap"
#include "rook_outline.bitmap"
#include "knight_outline.bitmap"
#include "bishop_outline.bitmap"
#include "queen_outline.bitmap"
#include "king_outline.bitmap"
#include "pawn_mask.bitmap"
#include "rook_mask.bitmap"
#include "knight_mask.bitmap"
#include "bishop_mask.bitmap"
#include "queen_mask.bitmap"
#include "king_mask.bitmap"
#include "shade.bitmap"
#include "xchess.cur"
#include "xchess_mask.cur"
#include "xchess.icon"
windata *win1, *win2;
bool win_flashmove = false;
extern bool setup();
extern void service(), drawgrid(), icon_refresh();
bool
win_setup(disp1, disp2)
char *disp1, *disp2;
{
win1 = alloc(windata);
if (!oneboard)
win2 = alloc(windata);
if (!setup(disp1, win1) || (!oneboard && !setup(disp2, win2)))
return (false);
if (blackflag) {
win1->color = BLACK;
win1->flipped = true;
} else
win1->color = WHITE;
win_drawboard(win1);
if (!oneboard) {
win2->color = BLACK;
win2->flipped = true;
win_drawboard(win2);
}
return(true);
}
/* Draw the chess board... */
void
win_drawboard(win)
windata *win;
{
int i, j;
drawgrid(win);
/* Now toss on the squares... */
for (i = 0; i < SIZE; i++)
for (j = 0; j < SIZE; j++)
win_erasepiece(j, i, win->color);
return;
}
/* Draw one piece. */
void
win_drawpiece(p, y, x, wnum)
piece *p;
int y, x;
color wnum;
{
char *bits, *maskbits, *outline;
windata *win;
char buf[BSIZE];
XImage *tmpImage;
Pixmap tmpPM, maskPM;
XGCValues gc;
if (oneboard || (wnum == win1->color))
win = win1;
else
win = win2;
if (win->flipped) {
y = SIZE - y - 1;
x = SIZE - x - 1;
}
/*
if (debug)
fprintf(stderr, "draw a %s at (%d, %d) on board %d\n",
piecenames[(int) p->type], y, x, wnum);
*/
if ((x < 0) || (x > 7) || (y < 0) || (y > 7)) exit(1);
switch (p->type) {
case PAWN:
bits = pawn_bits;
maskbits = pawn_mask_bits;
outline = pawn_outline_bits;
break;
case ROOK:
bits = rook_bits;
maskbits = rook_mask_bits;
outline = rook_outline_bits;
break;
case KNIGHT:
bits = knight_bits;
maskbits = knight_mask_bits;
outline = knight_outline_bits;
break;
case BISHOP:
bits = bishop_bits;
maskbits = bishop_mask_bits;
outline = bishop_outline_bits;
break;
case QUEEN:
bits = queen_bits;
maskbits = queen_mask_bits;
outline = queen_outline_bits;
break;
case KING:
bits = king_bits;
maskbits = king_mask_bits;
outline = king_outline_bits;
break;
default:
fprintf(stderr,
"Internal Error: win_drawpiece: bad piece type %d\n",
p->type);
}
/* There are two things we can do... If this is a black and white
* display, we have to shade the square and use an outline if the piece
* is white. We also have to use a mask... Since we don't want
* to use up too many bitmaps, create the mask bitmap, put the bits,
* and then destroy it.
*/
if (win->bnw && (p->color == WHITE))
bits = outline;
if (win->bnw && !iswhite(win, x, y)) {
XSetState(win->display, DefaultGC(win->display, 0),
BlackPixel(win->display, 0),
WhitePixel(win->display, 0), GXcopy, AllPlanes);
tmpPM = XCreateBitmapFromData(win->display, win->boardwin,
shade_bits, SQUARE_WIDTH, SQUARE_HEIGHT);
XCopyPlane(win->display, tmpPM, win->boardwin, DefaultGC(win->display, 0),
0, 0, SQUARE_WIDTH, SQUARE_HEIGHT,
x * (SQUARE_WIDTH + BORDER_WIDTH),
y * (SQUARE_HEIGHT + BORDER_WIDTH), 1);
XFreePixmap(win->display, tmpPM);
XSetFunction(win->display, DefaultGC(win->display, 0),
GXandInverted);
maskPM = XCreateBitmapFromData(win->display, win->boardwin,
maskbits, SQUARE_WIDTH, SQUARE_HEIGHT);
XCopyPlane(win->display, maskPM, win->boardwin, DefaultGC(win->display, 0),
0, 0, SQUARE_WIDTH, SQUARE_HEIGHT,
x * (SQUARE_WIDTH + BORDER_WIDTH),
y * (SQUARE_HEIGHT + BORDER_WIDTH), 1);
XFreePixmap(win->display, maskPM);
XSetFunction(win->display, DefaultGC(win->display, 0),
GXor);
tmpPM = XCreateBitmapFromData(win->display, win->boardwin,
bits, SQUARE_WIDTH, SQUARE_HEIGHT);
XCopyPlane(win->display, tmpPM, win->boardwin, DefaultGC(win->display, 0),
0, 0, SQUARE_WIDTH, SQUARE_HEIGHT,
x * (SQUARE_WIDTH + BORDER_WIDTH),
y * (SQUARE_HEIGHT + BORDER_WIDTH), 1);
XFreePixmap(win->display, tmpPM);
XSetFunction(win->display, DefaultGC(win->display, 0), GXcopy);
} else if (win->bnw){
XSetState(win->display, DefaultGC(win->display, 0),
BlackPixel(win->display, 0),
WhitePixel(win->display, 0), GXcopy, AllPlanes);
tmpPM = XCreateBitmapFromData(win->display, win->boardwin,
bits, SQUARE_WIDTH, SQUARE_HEIGHT);
XCopyPlane(win->display, tmpPM, win->boardwin, DefaultGC(win->display, 0),
0, 0, SQUARE_WIDTH, SQUARE_HEIGHT,
x * (SQUARE_WIDTH + BORDER_WIDTH),
y * (SQUARE_HEIGHT + BORDER_WIDTH), 1);
XFreePixmap(win->display, tmpPM);
} else {
XSetState(win->display, DefaultGC(win->display, 0),
((p->color == WHITE) ? win->whitepiece.pixel :
win->blackpiece.pixel),
(iswhite(win, x, y) ? win->whitesquare.pixel :
win->blacksquare.pixel),
GXcopy, AllPlanes);
tmpPM = XCreateBitmapFromData(win->display, win->boardwin,
bits, SQUARE_WIDTH, SQUARE_HEIGHT);
XCopyPlane(win->display, tmpPM, win->boardwin, DefaultGC(win->display, 0),
0, 0, SQUARE_WIDTH, SQUARE_HEIGHT,
x * (SQUARE_WIDTH + BORDER_WIDTH),
y * (SQUARE_HEIGHT + BORDER_WIDTH), 1);
XFreePixmap(win->display, tmpPM);
}
if (!record_english) {
gc.foreground = win->textcolor.pixel;
if (iswhite(win, x, y) || win->bnw)
gc.background = win->whitesquare.pixel;
else
gc.background = win->blacksquare.pixel;
gc.font = win->small->fid;
XChangeGC(win->display, DefaultGC(win->display, 0),
GCForeground | GCBackground | GCFont, &gc);
if (!x) {
sprintf(buf, " %d", SIZE - y);
XDrawImageString(win->display, win->boardwin,
DefaultGC(win->display, 0),
1, (y + 1) * (SQUARE_HEIGHT +
BORDER_WIDTH) - BORDER_WIDTH +
win->small->max_bounds.ascent - 1, buf, 2);
}
if (y == SIZE - 1) {
sprintf(buf, "%c", 'A' + x);
XDrawImageString(win->display, win->boardwin,
DefaultGC(win->display, 0),
x * (SQUARE_WIDTH + BORDER_WIDTH) + 1,
SIZE * (SQUARE_HEIGHT + BORDER_WIDTH) - BORDER_WIDTH +
win->small->max_bounds.ascent - 1, buf, 1);
}
}
return;
}
void
win_erasepiece(y, x, wnum)
int y, x;
color wnum;
{
windata *win;
char buf[BSIZE];
XGCValues gc;
Pixmap tmpPM;
if (oneboard || (wnum == win1->color))
win = win1;
else
win = win2;
if (win->flipped) {
y = SIZE - y - 1;
x = SIZE - x - 1;
}
/*
if (debug)
fprintf(stderr, "erase square (%d, %d) on board %d\n", y, x,
wnum);
*/
if ((x < 0) || (x > 7) || (y < 0) || (y > 7)) exit(1);
if (win->bnw && !iswhite(win, x, y)) {
XSetState(win->display, DefaultGC(win->display, 0),
BlackPixel(win->display, 0),
WhitePixel(win->display, 0), GXcopy, AllPlanes);
tmpPM = XCreateBitmapFromData(win->display, win->boardwin,
shade_bits, SQUARE_WIDTH, SQUARE_HEIGHT);
XCopyPlane(win->display, tmpPM, win->boardwin, DefaultGC(win->display, 0),
0, 0, SQUARE_WIDTH, SQUARE_HEIGHT,
x * (SQUARE_WIDTH + BORDER_WIDTH),
y * (SQUARE_HEIGHT + BORDER_WIDTH), 1);
XFreePixmap(win->display, tmpPM);
} else {
XSetFillStyle(win->display, DefaultGC(win->display, 0),
FillSolid);
XSetForeground(win->display, DefaultGC(win->display, 0),
iswhite(win, x, y) ? win->whitesquare.pixel :
win->blacksquare.pixel);
XFillRectangle(win->display, win->boardwin,
DefaultGC(win->display, 0),
x * (SQUARE_WIDTH + BORDER_WIDTH),
y * (SQUARE_HEIGHT + BORDER_WIDTH),
SQUARE_WIDTH, SQUARE_HEIGHT);
}
if (!record_english) {
gc.foreground = win->textcolor.pixel;
if (iswhite(win, x, y) || win->bnw)
gc.background = win->whitesquare.pixel;
else
gc.background = win->blacksquare.pixel;
gc.font = win->small->fid;
XChangeGC(win->display, DefaultGC(win->display, 0),
GCForeground | GCBackground | GCFont, &gc);
if (!x) {
sprintf(buf, " %d", SIZE - y);
XDrawImageString(win->display, win->boardwin,
DefaultGC(win->display, 0),
1, (y + 1) * (SQUARE_HEIGHT +
BORDER_WIDTH) - BORDER_WIDTH +
win->small->max_bounds.ascent - 1, buf, 2);
}
if (y == SIZE - 1) {
sprintf(buf, "%c", 'A' + x);
XDrawImageString(win->display, win->boardwin,
DefaultGC(win->display, 0),
x * (SQUARE_WIDTH + BORDER_WIDTH) + 1,
SIZE * (SQUARE_HEIGHT + BORDER_WIDTH) - BORDER_WIDTH +
win->small->max_bounds.ascent - 1, buf, 1);
}
}
return;
}
void
win_flash(m, wnum)
move *m;
color wnum;
{
windata *win;
int sx, sy, ex, ey, i;
if (oneboard || (wnum == win1->color))
win = win1;
else
win = win2;
if (win->flipped) {
sx = SIZE - m->fromx - 1;
sy = SIZE - m->fromy - 1;
ex = SIZE - m->tox - 1;
ey = SIZE - m->toy - 1;
} else {
sx = m->fromx;
sy = m->fromy;
ex = m->tox;
ey = m->toy;
}
sx = sx * (SQUARE_WIDTH + BORDER_WIDTH) + SQUARE_WIDTH / 2;
sy = sy * (SQUARE_HEIGHT + BORDER_WIDTH) + SQUARE_HEIGHT / 2;
ex = ex * (SQUARE_WIDTH + BORDER_WIDTH) + SQUARE_WIDTH / 2;
ey = ey * (SQUARE_HEIGHT + BORDER_WIDTH) + SQUARE_HEIGHT / 2;
for (i = 0; i < num_flashes * 2; i++)
XDrawLine(win->display,win->boardwin,
DefaultGC(win->display, 0),
sx, sy, ex, ey);
return;
}
/* Handle input from the players. */
void
win_process(quick)
bool quick;
{
int i, rfd = 0, wfd = 0, xfd = 0;
struct timeval timeout;
timeout.tv_sec = 0;
timeout.tv_usec = (quick ? 0 : 500000);
if (XPending(win1->display))
service(win1);
if (!oneboard) {
if (XPending(win1->display))
service(win2);
}
if (oneboard)
rfd = 1 << win1->display->fd;
else
rfd = (1 << win1->display->fd) | (1 << win2->display->fd);
if (!(i = select(32, &rfd, &wfd, &xfd, &timeout)))
return;
if (i == -1) {
perror("select");
exit(1);
}
if (rfd & (1 << win1->display->fd))
service(win1);
if (!oneboard && (rfd & (1 << win2->display->fd)))
service(win2);
return;
}
static void
service(win)
windata *win;
{
XEvent ev;
while(XPending(win->display)) {
XNextEvent(win->display, &ev);
if (TxtFilter(win->display, &ev))
continue;
if (ev.xany.window == win->boardwin) {
switch (ev.type) {
case ButtonPress:
button_pressed(&ev, win);
break;
case ButtonRelease:
button_released(&ev, win);
break;
case Expose:
/* Redraw... */
win_redraw(win, &ev);
break;
case 0:
case NoExpose:
break;
default:
fprintf(stderr, "Bad event type %d\n", ev.type);
exit(1);
}
} else if (ev.xany.window == win->wclockwin) {
switch (ev.type) {
case Expose:
clock_draw(win, WHITE);
break;
case 0:
case NoExpose:
break;
default:
fprintf(stderr, "Bad event type %d\n", ev.type);
exit(1);
}
} else if (ev.xany.window == win->bclockwin) {
switch (ev.type) {
case Expose:
clock_draw(win, BLACK);
break;
case 0:
case NoExpose:
break;
default:
fprintf(stderr, "Bad event type %d\n", ev.type);
exit(1);
}
} else if (ev.xany.window == win->jailwin) {
switch (ev.type) {
case Expose:
jail_draw(win);
break;
case 0:
case NoExpose:
break;
default:
fprintf(stderr, "Bad event type %d\n", ev.type);
exit(1);
}
} else if (ev.xany.window == win->buttonwin) {
switch (ev.type) {
case ButtonPress:
button_service(win, &ev);
break;
case Expose:
button_draw(win);
break;
case 0:
case NoExpose:
break;
default:
fprintf(stderr, "Bad event type %d\n", ev.type);
exit(1);
}
} else if (ev.xany.window == win->icon) {
icon_refresh(win);
} else if (ev.xany.window == win->basewin) {
message_send(win, &ev);
} else {
fprintf(stderr, "Internal Error: service: bad win\n");
fprintf(stderr, "window = %d, event = %d\n", ev.xany.window,
ev.type);
}
}
return;
}
void
win_redraw(win, event)
windata *win;
XEvent *event;
{
XExposeEvent *ev = &event->xexpose;
int x1, y1, x2, y2, i, j;
drawgrid(win);
if (ev) {
x1 = ev->x / (SQUARE_WIDTH + BORDER_WIDTH);
y1 = ev->y / (SQUARE_HEIGHT + BORDER_WIDTH);
x2 = (ev->x + ev->width) / (SQUARE_WIDTH + BORDER_WIDTH);
y2 = (ev->y + ev->height) / (SQUARE_HEIGHT + BORDER_WIDTH);
} else {
x1 = 0;
y1 = 0;
x2 = SIZE - 1;
y2 = SIZE - 1;
}
if (x1 < 0) x1 = 0;
if (y1 < 0) y1 = 0;
if (x2 < 0) x2 = 0;
if (y2 < 0) y2 = 0;
if (x1 > SIZE - 1) x1 = SIZE - 1;
if (y1 > SIZE - 1) y1 = SIZE - 1;
if (x2 > SIZE - 1) x2 = SIZE - 1;
if (y2 > SIZE - 1) y2 = SIZE - 1;
if (win->flipped) {
y1 = SIZE - y2 - 1;
y2 = SIZE - y1 - 1;
x1 = SIZE - x2 - 1;
x2 = SIZE - x1 - 1;
}
for (i = x1; i <= x2; i++)
for (j = y1; j <= y2; j++) {
if (chessboard->square[j][i].color == NONE)
win_erasepiece(j, i, WHITE);
else
win_drawpiece(&chessboard->square[j][i], j, i,
WHITE);
if (!oneboard) {
if (chessboard->square[j][i].color == NONE)
win_erasepiece(j, i, BLACK);
else
win_drawpiece(&chessboard->square[j][i],
j, i, BLACK);
}
}
return;
}
static bool
setup(dispname, win)
char *dispname;
windata *win;
{
char buf[BSIZE], *s;
Pixmap bm, bmask;
Cursor cur;
extern char *program, *recfile;
if (!(win->display = XOpenDisplay(dispname)))
return (false);
/* Now get boolean defaults... */
if ((s = XGetDefault(win->display, program, "noisy")) && eq(s, "on"))
noisyflag = true;
if ((s = XGetDefault(win->display, program, "savemoves")) && eq(s, "on"))
saveflag = true;
if ((s = XGetDefault(win->display, program, "algebraic")) && eq(s, "on"))
record_english = false;
if ((s = XGetDefault(win->display, program, "blackandwhite")) && eq(s, "on"))
bnwflag = true;
if ((s = XGetDefault(win->display, program, "quickrestore")) && eq(s, "on"))
quickflag = true;
if ((s = XGetDefault(win->display, program, "flash")) && eq(s, "on"))
win_flashmove = true;
/* ... numeric variables ... */
if (s = XGetDefault(win->display, program, "numflashes"))
num_flashes = atoi(s);
if (s = XGetDefault(win->display, program, "flashsize"))
flash_size = atoi(s);
/* ... and strings. */
if (s = XGetDefault(win->display, program, "progname"))
progname = s;
if (s = XGetDefault(win->display, program, "proghost"))
proghost = s;
if (s = XGetDefault(win->display, program, "recordfile"))
recfile = s;
if (s = XGetDefault(win->display, program, "blackpiece"))
black_piece_color = s;
if (s = XGetDefault(win->display, program, "whitepiece"))
white_piece_color = s;
if (s = XGetDefault(win->display, program, "blacksquare"))
black_square_color = s;
if (s = XGetDefault(win->display, program, "whitesquare"))
white_square_color = s;
if (s = XGetDefault(win->display, program, "bordercolor"))
border_color = s;
if (s = XGetDefault(win->display, program, "textcolor"))
text_color = s;
if (s = XGetDefault(win->display, program, "textback"))
text_back = s;
if (s = XGetDefault(win->display, program, "errortext"))
error_text = s;
if (s = XGetDefault(win->display, program, "playertext"))
player_text = s;
if (s = XGetDefault(win->display, program, "cursorcolor"))
cursor_color = s;
if ((DisplayPlanes(win->display, 0) == 1) || bnwflag)
win->bnw = true;
/* Allocate colors... */
if (win->bnw) {
win->blackpiece.pixel = BlackPixel (win->display, 0);
win->whitepiece.pixel = WhitePixel (win->display, 0);
win->blacksquare.pixel = BlackPixel (win->display, 0);
win->whitesquare.pixel = WhitePixel (win->display, 0);
win->border.pixel = BlackPixel (win->display, 0);
win->textcolor.pixel = BlackPixel (win->display, 0);
win->textback.pixel = WhitePixel (win->display, 0);
win->playertext.pixel = BlackPixel (win->display, 0);
win->errortext.pixel = BlackPixel (win->display, 0);
win->cursorcolor.pixel = BlackPixel (win->display, 0) ;
} else {
if (!XParseColor(win->display,
DefaultColormap(win->display, 0),
black_piece_color, &win->blackpiece) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
white_piece_color, &win->whitepiece) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
black_square_color, &win->blacksquare) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
white_square_color, &win->whitesquare) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
border_color, &win->border) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
text_color, &win->textcolor) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
text_back, &win->textback) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
error_text, &win->errortext) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
player_text, &win->playertext) ||
!XParseColor(win->display,
DefaultColormap(win->display, 0),
cursor_color, &win->cursorcolor) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->blackpiece) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->whitepiece) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->blacksquare) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->whitesquare) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->border) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->textcolor) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->textback) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->errortext) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->playertext) ||
!XAllocColor(win->display,
DefaultColormap(win->display, 0),
&win->cursorcolor))
fprintf(stderr, "Can't get color...\n");
}
/* Get fonts... */
win->small = XLoadQueryFont(win->display,SMALL_FONT);
win->medium = XLoadQueryFont(win->display,MEDIUM_FONT);
win->large = XLoadQueryFont(win->display,LARGE_FONT);
/* Create the windows... */
win->basewin =
XCreateSimpleWindow(win->display,DefaultRootWindow(win->display),
BASE_XPOS, BASE_YPOS,
BASE_WIDTH, BASE_HEIGHT, 0,
BlackPixel(win->display, 0),
WhitePixel(win->display, 0));
win->boardwin = XCreateSimpleWindow(win->display,win->basewin,
BOARD_XPOS, BOARD_YPOS,
BOARD_WIDTH, BOARD_HEIGHT,
BORDER_WIDTH,
win->border.pixel,
WhitePixel(win->display, 0));
win->recwin = XCreateSimpleWindow(win->display,win->basewin,
RECORD_XPOS, RECORD_YPOS,
RECORD_WIDTH, RECORD_HEIGHT,
BORDER_WIDTH, win->border.pixel,
win->textback.pixel);
win->jailwin = XCreateSimpleWindow(win->display,win->basewin,
JAIL_XPOS, JAIL_YPOS,
JAIL_WIDTH, JAIL_HEIGHT,
BORDER_WIDTH,
win->border.pixel,
win->textback.pixel);
win->wclockwin = XCreateSimpleWindow(win->display,win->basewin,
WCLOCK_XPOS, WCLOCK_YPOS,
CLOCK_WIDTH, CLOCK_HEIGHT,
BORDER_WIDTH, win->border.pixel,
win->textback.pixel);
win->bclockwin = XCreateSimpleWindow(win->display,win->basewin,
BCLOCK_XPOS, BCLOCK_YPOS,
CLOCK_WIDTH, CLOCK_HEIGHT,
BORDER_WIDTH, win->border.pixel,
win->textback.pixel);
win->messagewin = XCreateSimpleWindow(win->display,win->basewin,
MESS_XPOS, MESS_YPOS,
MESS_WIDTH, MESS_HEIGHT,
BORDER_WIDTH, win->border.pixel,
win->textback.pixel);
win->buttonwin = XCreateSimpleWindow(win->display,win->basewin,
BUTTON_XPOS, BUTTON_YPOS,
BUTTON_WIDTH, BUTTON_HEIGHT,
BORDER_WIDTH, win->border.pixel,
win->textback.pixel);
/* Let's define an icon... */
win->iconpixmap = XCreatePixmapFromBitmapData(win->display,
win->basewin, icon_bits,
icon_width, icon_height,
win->blacksquare.pixel,
win->whitesquare.pixel,
1);
bm = XCreateBitmapFromData(win->display,
win->basewin, xchess_bits,
xchess_width, xchess_height);
bmask = XCreateBitmapFromData(win->display,
win->basewin, xchess_mask_bits,
xchess_width, xchess_height);
cur = XCreatePixmapCursor(win->display, bm, bmask,
&win->cursorcolor,
&WhitePixel(win->display, 0),
xchess_x_hot, xchess_y_hot);
XFreePixmap(win->display, bm);
XFreePixmap(win->display, bmask);
XDefineCursor(win->display,win->basewin, cur);
XMapSubwindows(win->display,win->basewin);
XMapRaised(win->display,win->basewin);
XSelectInput(win->display,win->basewin, KeyPressMask);
XSelectInput(win->display,win->boardwin,
ButtonPressMask | ButtonReleaseMask | ExposureMask);
XSelectInput(win->display,win->recwin,
ButtonReleaseMask | ExposureMask);
XSelectInput(win->display,win->jailwin, ExposureMask);
XSelectInput(win->display,win->wclockwin, ExposureMask);
XSelectInput(win->display,win->bclockwin, ExposureMask);
XSelectInput(win->display,win->messagewin,
ButtonReleaseMask | ExposureMask);
XSelectInput(win->display,win->buttonwin,
ButtonPressMask | ExposureMask);
message_init(win);
record_init(win);
button_draw(win);
jail_init(win);
clock_init(win, WHITE);
clock_init(win, BLACK);
if (timeunit) {
if (timeunit > 1800)
sprintf(buf, "%d moves every %.2lg hours.\n",
movesperunit, ((double) timeunit) / 3600);
else if (timeunit > 30)
sprintf(buf, "%d moves every %.2lg minutes.\n",
movesperunit, ((double) timeunit) / 60);
else
sprintf(buf, "%d moves every %d seconds.\n",
movesperunit, timeunit);
message_add(win, buf, false);
}
return (true);
}
static void
drawgrid(win)
windata *win;
{
int i;
XGCValues gc;
gc.function = GXcopy;
gc.plane_mask = AllPlanes;
gc.foreground = win->border.pixel;
gc.line_width = 0;
gc.line_style = LineSolid;
XChangeGC(win->display,
DefaultGC(win->display, 0),
GCFunction | GCPlaneMask | GCForeground |
GCLineWidth | GCLineStyle, &gc);
/* Draw the lines... horizontal, */
for (i = 1; i < SIZE; i++)
XDrawLine(win->display, win->boardwin,
DefaultGC(win->display, 0), 0,
i * (SQUARE_WIDTH + BORDER_WIDTH) -
BORDER_WIDTH / 2,
SIZE * (SQUARE_WIDTH + BORDER_WIDTH),
i * (SQUARE_WIDTH + BORDER_WIDTH) -
BORDER_WIDTH / 2);
/* and vertical... */
for (i = 1; i < SIZE; i++)
XDrawLine(win->display, win->boardwin,
DefaultGC(win->display, 0),
i * (SQUARE_WIDTH + BORDER_WIDTH) -
BORDER_WIDTH / 2, 0,
i * (SQUARE_WIDTH + BORDER_WIDTH) -
BORDER_WIDTH / 2,
SIZE * (SQUARE_WIDTH + BORDER_WIDTH));
return;
}
void
win_restart()
{
win1->flipped = false;
win_redraw(win1, (XEvent *) NULL);
if (!oneboard) {
win2->flipped = true;
win_redraw(win2, (XEvent *) NULL);
}
return;
}
static void
icon_refresh(win)
windata *win;
{
XCopyArea(win->display, win->iconpixmap, win->icon,
DefaultGC(win->display, 0),
0, 0, icon_width, icon_height, 0, 0);
return;
}

View File

@ -1,217 +0,0 @@
.\" $Id: xchess.1,v 1.2 1993/08/02 17:21:06 mycroft Exp $ -*- nroff -*-
.TH XCHESS 1 "14 Nov 1986" "X Version 10"
.SH NAME
xchess \- X chess display
.SH SYNOPSIS
.B xchess
[ option ... ] [ white-display ] [ black-display ]
.SH DESCRIPTION
.PP
.B xchess
is a chess display program which allows players to play a game on either
one or two displays, or play a chess-playing program. It uses the
.B X
window system. If one or no display names are given, it will open up one
window and both black and white at the same board. If two displays are
given,
.B xchess
will accept moves from each player in his turn. Black's board will be drawn
with his pieces at the bottom.
.PP
.B xchess
will not allow a player to make an illegal move. It accepts all legal moves,
including castling and pawn capture \fIen passant\fR.
.SH OPTIONS
.TP 8
.B -d
Turn on debugging.
.TP 8
.B -f record-file
Use \fBrecord-file\fR for saving the game when the \fBSave\fR button is
selected, or if the \fB-s\fR flag is given. The default is "xchess.game".
.TP 8
.B -r saved-game
Start with the position at the end of the saved game in the named file.
This file may be the result of the \fBSave\fR command, and may be in
either English or International format. When reading moves, one move
it made per second.
.TP 8
.B -q
Don't pause for a second every time a move is made when a game is being
restored.
.TP 8
.B -v
Whenever a piece is moved, outline the path with a "lightning bolt".
This option and the \fB-n\fR option are useful if you don't want to miss
an opponent's move when he makes it.
.TP 8
.B -i
Use International format for recording moves (squares numbered 1-8, a-h)
as opposed to English (e.g, \fIp/k4xp/q5\fR).
.TP 8
.B -t moves/timeunit
Allows \fBtimeunit\fR seconds for every \fBmoves\fR moves. If either player
exceeds this allowance both recieve a message saying informing them of
this fact.
.TP 8
.B -c
Play the computer.
.B xchess
will start up a chess-playing program (currently the only one it knows
how to talk to is \fBGNU Chess\fR).
.TP 8
.B -p program
The name of the program to use if the \fB-c\fR option is given. The
default is "/usr/public/gnuchess". Note that \fBgnuchess\fR must be
compiled with the \fIcompat\fR flag (in the file "main.c") set to 1.
.TP 8
.B -b
If the \fB-c\fR flag was given, have the computer play white.
.TP 8
.B -bnw
If the display has more than one display plane (i.e, is color), pretend
it's black and white.
.TP 8
.B -s
Save the moves in the record file as they are made. This is useful if
you don't want your game to be lost when \fBxchess\fR core dumps.
.TP 8
.B -n
Be noisy \- beep after every move is made.
.TP 8
.B -h host
Run GNU Chess on the specified \fBhost\fR.
.TP 8
.B -R
Randomly chose who plays white and who plays black, if two displays are
given.
.SH CONTROLS
.PP
The window is divided up into several sub-windows. The pieces are moved by
pushing down any mouse button on top of the piece, moving to the destination
square, and releasing it. Castling is done by moving the king to the
right square. If you push down on a piece and then let the button
up without moving it, you must move that piece. ("Touch it, move it.")
.PP
The progress of the game is listed in the "Game Record" window. Error
messages and such things are printed in the "Message" window. Both these
windows have scroll bars that you can use to move around.
There are also windows for clocks and for a record of the pieces captured.
.PP
If you type any keys in the window, the text will go into the message
window of both players. This provides a simple communication facility.
.PP
There are 9 buttons in the control window. They are as follows:
.TP 8
.B Draw
Both players must push this button to agree on a draw (just one is ok
if only one display is being used).
.TP 8
.B Resign
The player whose turn it is to move resigns.
.TP 8
.B Reset
Start over from the beginning.
.TP 8
.B Back
Retract a move. If two displays are being used the other player will be
asked to confirm this.
.TP 8
.B Fwd
This will re-play the most recently retracted move. This button in conjunction
with \fBBack\fR is useful for "scrolling around" in a saved game.
.TP 8
.B Save
Save the game in the record file.
.TP 8
.B Flip
Rotate the board so that Black will have his pieces at the bottom.
.TP 8
.B Switch
Change the mapping of boards to players.
.TP 8
.B Pause
This button has two functions. When a game is being restored, pieces will
be moved once a second. Hitting \fBPause\fR will stop this process, and
hitting it again will restart it. During the time that it is stopped no
other action can be made except restarting it. While a game is being played,
\fBPause\fR will stop the clock and restart it.
.SH DEFAULTS
.PP
\fBxchess\fR uses the following \fI.Xdefaults\fR:
.TP 8
.B Noisy
The -n flag.
.TP 8
.B SaveMoves
The -s flag.
.TP 8
.B Algebraic
The -i flag.
.TP 8
.B BlackAndWhite
The -bnw flag.
.TP 8
.B QuickRestore
The -q flag.
.TP 8
.B Flash
The -v flag.
.TP 8
.B NumFlashes
How many times to flash the move. The default is 5.
.TP 8
.B FlashWidth
How big to make the lightning bolt. The default is 10 pixels.
.TP 8
.B ProgName
The -p option. This may also be changed in the Makefile (-DDEF_PROG_NAME).
.TP 8
.B ProgHost
The -h option.
.TP 8
.B RecordFile
The -f option.
.TP 8
.B BlackPiece
The color of the black pieces.
.TP 8
.B WhitePiece
The color of the white pieces.
.TP 8
.B BorderColor
The color of the borders.
.TP 8
.B BlackSquare
The color of the black squares.
.TP 8
.B WhiteSquare
The color of the white squares.
.TP 8
.B TextColor
The color of routine messages and the move record text.
.TP 8
.B ErrorText
The color of error messages.
.TP 8
.B PlayerText
The color of player-entered text.
.TP 8
.B TextBack
The background color for the two text windows.
.TP 8
.B CursorColor
The color of the mouse and the text cursors.
.SH "SEE ALSO"
X(8), gnuchess(1), chess(5)
.SH AUTHOR
Wayne A. Christopher (faustus@ic.berkeley.edu)
.SH BUGS
.PP
Checkmate and stalemate are not detected, so the appropriate player must resign
or agree to a draw respectively.
.PP
\fBSwitch\fR doesn't work.
.PP
If you are playing \fBgnuchess\fR, and you select Undo a few times so that it
is \fBgnuchess\fR's turn to move, it won't do anything.

View File

@ -1,206 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
static char rcsid[] = "$Id: xchess.c,v 1.2 1993/08/02 17:21:08 mycroft Exp $";
#endif /* not lint */
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*/
#define USAGE "xchess [ -d ] [ -f recordfile ] [ -r savedfile ] [ -i ]\n\
\t[ -t moves/timeunit ] [ -c ] [ -p program ] [ -b ] [ -bnw ] [ -s ]\n\
\t[ -n ] [ -h host ] [ -v ] [ -R ] [ whitedisplay ] [ blackdisplay ]"
#include <signal.h>
#include "xchess.h"
bool debug = false;
bool oneboard = false;
bool bnwflag = false;
bool progflag = false;
bool blackflag = false;
bool quickflag = false;
char *progname = DEF_PROGRAM;
char *proghost = NULL;
char *piecenames[] = { "pawn", "rook", "knight", "bishop", "queen", "king" } ;
char *colornames[] = { "white", "black", "none" } ;
char *movetypenames[] = { "move", "qcastle", "kcastle", "capture" } ;
char *dispname1 = NULL, *dispname2 = NULL;
char *black_piece_color = BLACK_PIECE_COLOR;
char *white_piece_color = WHITE_PIECE_COLOR;
char *black_square_color = BLACK_SQUARE_COLOR;
char *white_square_color = WHITE_SQUARE_COLOR;
char *border_color = BORDER_COLOR;
char *text_color = TEXT_COLOR;
char *text_back = TEXT_BACK;
char *error_text = ERROR_TEXT;
char *player_text = PLAYER_TEXT;
char *cursor_color = CURSOR_COLOR;
int num_flashes = NUM_FLASHES;
int flash_size = FLASH_SIZE;
char *program;
char *recfile = NULL;
#ifdef notdef
/*
* Serves no purpose.
*/
die () {
fprintf(stderr, "child proc changed status?!\n");
}
#endif
void
main(ac, av)
char **av;
{
bool randflag = false;
move *m;
char *s;
program = av[0];
#ifdef notdef
signal(SIGCHLD, die);
#endif
/* Process args. */
av++; ac--;
while (ac > 0 && **av == '-') {
if (eq(*av, "-d")) {
debug = true;
} else if (eq(*av, "-f")) {
av++; ac--;
if (*av)
record_file = *av;
else
goto usage;
} else if (eq(*av, "-r")) {
av++; ac--;
if (*av)
recfile = *av;
else
goto usage;
} else if (eq(*av, "-i")) {
record_english = false;
} else if (eq(*av, "-R")) {
randflag = true;
} else if (eq(*av, "-v")) {
win_flashmove = true;
} else if (eq(*av, "-q")) {
quickflag = true;
} else if (eq(*av, "-t")) {
av++; ac--;
if (*av) {
movesperunit = atoi(*av);
if (s = index(*av, '/'))
timeunit = atoi(s + 1) * 60;
else
timeunit = 60;
} else
goto usage;
} else if (eq(*av, "-p")) {
av++; ac--;
if (*av)
progname = *av;
else
goto usage;
} else if (eq(*av, "-h")) {
av++; ac--;
if (*av)
proghost = *av;
else
goto usage;
} else if (eq(*av, "-b")) {
blackflag = true;
} else if (eq(*av, "-c")) {
progflag = true;
} else if (eq(*av, "-bnw")) {
bnwflag = true;
} else if (eq(*av, "-s")) {
saveflag = true;
} else if (eq(*av, "-n")) {
noisyflag = true;
} else
goto usage;
av++; ac--;
}
if (ac > 0)
dispname1 = av[0];
if (ac > 1)
dispname2 = av[1];
if (ac > 2)
goto usage;
if (!dispname2)
oneboard = true;
srandom(getpid());
if (!oneboard && randflag && (random() % 2)) {
s = dispname1;
dispname1 = dispname2;
dispname2 = s;
}
if (!dispname1)
dispname1 = getenv("DISPLAY");
/* Set up the board. */
board_setup();
/* Create the windows. */
win_setup(dispname1, dispname2);
board_drawall();
/* Start the program if necessary. */
if (progflag)
if (!program_init(progname))
exit(1);
if (recfile)
load_game(recfile);
/* Go into a loop of prompting players alternately for moves, checking
* them, and updating things.
*/
for (;;) {
win_process(false);
clock_update();
if (progflag && ((!blackflag && (nexttomove == BLACK)) ||
(blackflag && (nexttomove == WHITE)))) {
m = program_get();
if (m)
prog_move(m);
}
}
usage: fprintf(stderr, "Usage: %s\n", USAGE);
exit(1);
}

View File

@ -1,197 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
/* RCS Info: $Revision: 1.1.1.1 $ on $Date: 1993/03/21 09:45:37 $
* $Source: /cvsroot/src/gnu/games/chess/Xchess/Attic/xchess.c.150,v $
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*/
#define USAGE "xchess [ -d ] [ -f recordfile ] [ -r savedfile ] [ -i ]\n\
\t[ -t moves/timeunit ] [ -c ] [ -p program ] [ -b ] [ -bnw ] [ -s ]\n\
\t[ -n ] [ -h host ] [ -v ] [ -R ] [ whitedisplay ] [ blackdisplay ]"
#include <signal.h>
#include "xchess.h"
bool debug = false;
bool oneboard = false;
bool bnwflag = false;
bool progflag = false;
bool blackflag = false;
bool quickflag = false;
char *progname = DEF_PROGRAM;
char *proghost = NULL;
char *piecenames[] = { "pawn", "rook", "knight", "bishop", "queen", "king" } ;
char *colornames[] = { "white", "black", "none" } ;
char *movetypenames[] = { "move", "qcastle", "kcastle", "capture" } ;
char *dispname1 = NULL, *dispname2 = NULL;
char *black_piece_color = BLACK_PIECE_COLOR;
char *white_piece_color = WHITE_PIECE_COLOR;
char *black_square_color = BLACK_SQUARE_COLOR;
char *white_square_color = WHITE_SQUARE_COLOR;
char *border_color = BORDER_COLOR;
char *text_color = TEXT_COLOR;
char *text_back = TEXT_BACK;
char *error_text = ERROR_TEXT;
char *player_text = PLAYER_TEXT;
char *cursor_color = CURSOR_COLOR;
int num_flashes = NUM_FLASHES;
int flash_size = FLASH_SIZE;
char *program;
char *recfile = NULL;
die () {
fprintf(stderr, "child proc changed status?!\n");
}
void
main(ac, av)
char **av;
{
bool randflag = false;
move *m;
char *s;
program = av[0];
signal(SIGCHLD, die);
/* Process args. */
av++; ac--;
while (ac > 0 && **av == '-') {
if (eq(*av, "-d")) {
debug = true;
} else if (eq(*av, "-f")) {
av++; ac--;
if (*av)
record_file = *av;
else
goto usage;
} else if (eq(*av, "-r")) {
av++; ac--;
if (*av)
recfile = *av;
else
goto usage;
} else if (eq(*av, "-i")) {
record_english = false;
} else if (eq(*av, "-R")) {
randflag = true;
} else if (eq(*av, "-v")) {
win_flashmove = true;
} else if (eq(*av, "-q")) {
quickflag = true;
} else if (eq(*av, "-t")) {
av++; ac--;
if (*av) {
movesperunit = atoi(*av);
if (s = index(*av, '/'))
timeunit = atoi(s + 1) * 60;
else
timeunit = 60;
} else
goto usage;
} else if (eq(*av, "-p")) {
av++; ac--;
if (*av)
progname = *av;
else
goto usage;
} else if (eq(*av, "-h")) {
av++; ac--;
if (*av)
proghost = *av;
else
goto usage;
} else if (eq(*av, "-b")) {
blackflag = true;
} else if (eq(*av, "-c")) {
progflag = true;
} else if (eq(*av, "-bnw")) {
bnwflag = true;
} else if (eq(*av, "-s")) {
saveflag = true;
} else if (eq(*av, "-n")) {
noisyflag = true;
} else
goto usage;
av++; ac--;
}
if (ac > 0)
dispname1 = av[0];
if (ac > 1)
dispname2 = av[1];
if (ac > 2)
goto usage;
if (!dispname2)
oneboard = true;
srandom(getpid());
if (!oneboard && randflag && (random() % 2)) {
s = dispname1;
dispname1 = dispname2;
dispname2 = s;
}
if (!dispname1)
dispname1 = getenv("DISPLAY");
/* Set up the board. */
board_setup();
/* Create the windows. */
win_setup(dispname1, dispname2);
board_drawall();
/* Start the program if necessary. */
if (progflag)
if (!program_init(progname))
exit(1);
if (recfile)
load_game(recfile);
/* Go into a loop of prompting players alternately for moves, checking
* them, and updating things.
*/
for (;;) {
win_process(false);
clock_update();
if (progflag && ((!blackflag && (nexttomove == BLACK)) ||
(blackflag && (nexttomove == WHITE)))) {
m = program_get();
if (m)
prog_move(m);
}
}
usage: fprintf(stderr, "Usage: %s\n", USAGE);
exit(1);
}

View File

@ -1,9 +0,0 @@
#define xchess_width 16
#define xchess_height 16
#define xchess_x_hot 9
#define xchess_y_hot 8
static char xchess_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xf8, 0x00, 0xfe, 0x80, 0xff,
0xc0, 0xff, 0x60, 0xff, 0xb0, 0xfd, 0xd8, 0x66, 0x6c, 0x3b, 0x76, 0x1d,
0x98, 0x1d, 0xcc, 0x0c, 0x60, 0x00, 0x00, 0x00};

View File

@ -1,8 +0,0 @@
X Chess -- Sun Sep 18 18:01:17 EDT 1988
Game played on pitcairn:0
english
1. P/kb2-kb4 P/k2-k3
2. P/k2-k4
Draw agreed.
Time: white: 6s, black: 43s

View File

@ -1,302 +0,0 @@
/* This file contains code for X-CHESS.
Copyright (C) 1986 Free Software Foundation, Inc.
This file is part of X-CHESS.
X-CHESS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the X-CHESS General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
X-CHESS, but only under the conditions described in the
X-CHESS General Public License. A copy of this license is
supposed to have been given to you along with X-CHESS so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies.
$Id: xchess.h,v 1.2 1993/08/02 17:21:10 mycroft Exp $
*/
/*
* Copyright (c) 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
* Permission is granted to do anything with this code except sell it
* or remove this message.
*
* Definitions for the X chess program.
*/
#include "std.h"
#include <X11/Xlib.h>
#include "scrollText/scrollText.h"
#define SIZE 8
typedef enum piecetype { PAWN, ROOK, KNIGHT, BISHOP, QUEEN, KING } piecetype;
typedef enum movetype { MOVE, QCASTLE, KCASTLE, CAPTURE } movetype;
typedef enum color { WHITE, BLACK, NONE } color;
typedef struct piece {
enum piecetype type;
enum color color;
} piece;
/* The board has y=0 and black at the top... This probably isn't the best
* place to keep track of who can castle, but it's part of the game state...
*/
typedef struct board {
piece square[SIZE][SIZE];
bool white_cant_castle_k;
bool white_cant_castle_q;
bool black_cant_castle_k;
bool black_cant_castle_q;
} board;
typedef struct move {
movetype type;
piece piece;
piece taken;
int fromx, fromy;
int tox, toy;
struct move *next;
bool enpassant;
bool check;
} move;
#define iswhite(win, i, j) (!(((i) + (j)) % 2))
/* Stuff for the display. */
typedef struct windata {
Display *display;
Window basewin;
Window boardwin;
Window recwin;
Window wclockwin;
Window bclockwin;
Window messagewin;
Window buttonwin;
Window jailwin;
Window icon;
Pixmap iconpixmap;
XColor blackpiece;
XColor whitepiece;
XColor blacksquare;
XColor whitesquare;
XColor border;
XColor textcolor;
XColor textback;
XColor errortext;
XColor playertext;
XColor cursorcolor;
XFontStruct *small;
XFontStruct *medium;
XFontStruct *large;
bool bnw;
color color;
bool flipped;
double whitehands[3];
double blackhands[3];
char *txtassoc;
} windata;
#define SMALL_FONT "6x10"
#define MEDIUM_FONT "8x13"
#define LARGE_FONT "9x15"
#define JAIL_FONT "6x10"
#define SQUARE_WIDTH 80
#define SQUARE_HEIGHT 80
#define BORDER_WIDTH 3
#define BOARD_WIDTH 8 * SQUARE_WIDTH + 7 * BORDER_WIDTH
#define BOARD_HEIGHT 8 * SQUARE_HEIGHT + 7 * BORDER_WIDTH
#define BOARD_XPOS 0
#define BOARD_YPOS 0
#define RECORD_WIDTH 265 /* 40 chars * 6 pixels / character. */
#define RECORD_HEIGHT 433
#define RECORD_XPOS BOARD_WIDTH + BORDER_WIDTH
#define RECORD_YPOS 0
#define JAIL_WIDTH RECORD_WIDTH
#define JAIL_HEIGHT 163
#define JAIL_XPOS RECORD_XPOS
#define JAIL_YPOS RECORD_YPOS + RECORD_HEIGHT + BORDER_WIDTH
#define CLOCK_WIDTH 131
#define CLOCK_HEIGHT 131 + BORDER_WIDTH + 20
#define WCLOCK_XPOS RECORD_XPOS
#define WCLOCK_YPOS RECORD_HEIGHT + JAIL_HEIGHT + BORDER_WIDTH * 2
#define BCLOCK_XPOS WCLOCK_XPOS + CLOCK_WIDTH + BORDER_WIDTH
#define BCLOCK_YPOS WCLOCK_YPOS
#define MESS_WIDTH 329
#define MESS_HEIGHT 92
#define MESS_XPOS 0
#define MESS_YPOS BOARD_HEIGHT + BORDER_WIDTH
#define BUTTON_WIDTH MESS_WIDTH
#define BUTTON_HEIGHT MESS_HEIGHT
#define BUTTON_XPOS MESS_WIDTH + BORDER_WIDTH
#define BUTTON_YPOS MESS_YPOS
#define BASE_WIDTH BOARD_WIDTH + RECORD_WIDTH + BORDER_WIDTH * 3
#define BASE_HEIGHT BOARD_HEIGHT + MESS_HEIGHT + BORDER_WIDTH * 3
#define BASE_XPOS 50
#define BASE_YPOS 50
#define BLACK_PIECE_COLOR "#202020"
#define WHITE_PIECE_COLOR "#FFFFCC"
#define BLACK_SQUARE_COLOR "#77A26D"
#define WHITE_SQUARE_COLOR "#C8C365"
#define BORDER_COLOR "#902E39"
#define TEXT_COLOR "#006D6D"
#define TEXT_BACK "#FFFFDD"
#define ERROR_TEXT "Red"
#define PLAYER_TEXT "Blue"
#define CURSOR_COLOR "#FF606F"
#define DEF_RECORD_FILE "xchess.game"
#define NUM_FLASHES 5
#define FLASH_SIZE 10
/* xchess.c */
extern void main();
extern bool debug;
extern char *progname;
extern char *proghost;
extern char *piecenames[];
extern char *colornames[];
extern char *movetypenames[];
extern char *dispname1, *dispname2;
extern bool oneboard;
extern bool bnwflag;
extern bool progflag;
extern bool blackflag;
extern bool quickflag;
extern int num_flashes;
extern int flash_size;
extern char *black_piece_color;
extern char *white_piece_color;
extern char *black_square_color;
extern char *white_square_color;
extern char *border_color;
extern char *text_color;
extern char *text_back;
extern char *error_text;
extern char *player_text;
extern char *cursor_color;
/* board.c */
extern void board_setup();
extern void board_drawall();
extern void board_move();
extern board *chessboard;
extern void board_init();
/* window.c */
extern bool win_setup();
extern void win_redraw();
extern void win_restart();
extern void win_drawboard();
extern void win_drawpiece();
extern void win_erasepiece();
extern void win_process();
extern void win_flash();
extern windata *win1, *win2;
extern bool win_flashmove;
/* control.c */
extern void button_pressed();
extern void button_released();
extern void move_piece();
extern void prog_move();
extern move *moves;
extern move *foremoves;
extern color nexttomove;
extern void replay();
extern void forward();
extern void cleanup();
extern void restart();
extern bool noisyflag;
/* valid.c */
extern bool valid_move();
/* record.c */
extern void record_move();
extern void record_reset();
extern void record_save();
extern void record_back();
extern void record_init();
extern void record_end();
extern bool record_english;
extern char *record_file;
extern int movenum;
extern bool saveflag;
/* message.c */
extern void message_init();
extern void message_add();
extern void message_send();
/* clock.c */
extern void clock_init();
extern void clock_draw();
extern void clock_update();
extern void clock_switch();
extern bool clock_started;
extern int movesperunit;
extern int timeunit;
extern int whiteseconds;
extern int blackseconds;
/* button.c */
extern void button_draw();
extern void button_service();
/* jail.c */
extern void jail_init();
extern void jail_draw();
extern void jail_add();
extern void jail_remove();
/* program.c */
extern bool program_init();
extern void program_end();
extern void program_send();
extern void program_undo();
extern move *program_get();
/* parse.c */
extern void load_game();
extern move *parse_file();
extern move *parse_move();
extern move *parse_imove();
extern bool loading_flag;
extern bool loading_paused;
/* popup.c */
extern bool pop_question();

View File

@ -1,28 +0,0 @@
#define icon_width 48
#define icon_height 48
static char icon_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80,
0xc1, 0xff, 0xff, 0xff, 0xff, 0x83, 0x41, 0x00, 0x00, 0x00, 0x00, 0x82,
0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82, 0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82,
0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82, 0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82,
0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82, 0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82,
0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82, 0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82,
0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82, 0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82,
0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82, 0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82,
0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82, 0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82,
0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82, 0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82,
0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82, 0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82,
0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82, 0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82,
0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82, 0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82,
0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82, 0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82,
0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82, 0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82,
0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82, 0x41, 0xf0, 0xf0, 0xf0, 0xf0, 0x82,
0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82, 0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82,
0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82, 0x41, 0x0f, 0x0f, 0x0f, 0x0f, 0x82,
0x41, 0x00, 0x00, 0x00, 0x00, 0x82, 0xc1, 0xff, 0xff, 0xff, 0xff, 0x83,
0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x41, 0xc4, 0x89, 0x3c, 0xcf, 0x83,
0x41, 0x24, 0x88, 0x04, 0x41, 0x80, 0x81, 0x22, 0x88, 0x04, 0x41, 0x80,
0x01, 0x21, 0xf8, 0x1c, 0xcf, 0x83, 0x81, 0x22, 0x88, 0x04, 0x08, 0x82,
0x41, 0x24, 0x88, 0x04, 0x08, 0x82, 0x41, 0xc4, 0x89, 0x3c, 0xcf, 0x83,
0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

View File

@ -1,7 +0,0 @@
#define xchess_mask_width 16
#define xchess_mask_height 16
static char xchess_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xf8, 0x00, 0xfe, 0x80, 0xff,
0xc0, 0xff, 0x60, 0xff, 0xb0, 0xfd, 0xd8, 0x66, 0x6c, 0x3b, 0x76, 0x1d,
0x98, 0x1d, 0xcc, 0x0c, 0x60, 0x00, 0x00, 0x00};

View File

@ -1,397 +0,0 @@
// This may look like C code, but it is really -*- C++ -*-
/*
Copyright (C) 1989 Free Software Foundation
written by Eric Newton (newton@rocky.oswego.edu)
This file is part of GNU CC.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the GNU CC General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
GNU CC, but only under the conditions described in the
GNU CC General Public License. A copy of this license is
supposed to have been given to you along with GNU CC so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies.
*/
#ifndef _CursesWindow_h
#ifdef __GNUG__
#pragma once
#pragma interface
#endif
#define _CursesWindow_h
#ifdef __GNUG__
#pragma once
#pragma interface
#endif
#include <curses.h>
/*
*
* C++ class for windows.
*
*
*/
class CursesWindow
{
protected:
static int count; // count of all active windows:
// We rely on the c++ promise that
// all otherwise uninitialized
// static class vars are set to 0
WINDOW * w; // the curses WINDOW
int alloced; // true if we own the WINDOW
CursesWindow* par; // parent, if subwindow
CursesWindow* subwins; // head of subwindows list
CursesWindow* sib; // next subwindow of parent
void kill_subwindows(); // disable all subwindows
public:
CursesWindow(WINDOW* &window); // useful only for stdscr
CursesWindow(int lines, // number of lines
int cols, // number of columns
int begin_y, // line origin
int begin_x); // col origin
CursesWindow(CursesWindow& par, // parent window
int lines, // number of lines
int cols, // number of columns
int by, // absolute or relative
int bx, // origins:
char absrel = 'a'); // if `a', by & bx are
// absolute screen pos,
// else if `r', they are
// relative to par origin
~CursesWindow();
// terminal status
int lines(); // number of lines on terminal, *not* window
int cols(); // number of cols on terminal, *not* window
// window status
int height(); // number of lines in this window
int width(); // number of cols in this window
int begx(); // smallest x coord in window
int begy(); // smallest y coord in window
int maxx(); // largest x coord in window
int maxy(); // largest x coord in window
// window positioning
int move(int y, int x);
// coordinate positioning
void getyx(int& y, int& x);
int mvcur(int sy, int ey, int sx, int ex);
// input
int getch();
int getstr(char * str);
int scanw(const char *, ...);
// input + positioning
int mvgetch(int y, int x);
int mvgetstr(int y, int x, char * str);
int mvscanw(int, int, const char*, ...);
// output
int addch(const char ch);
int addstr(const char * str);
int printw(const char * fmt, ...);
int inch();
int insch(char c);
int insertln();
// output + positioning
int mvaddch(int y, int x, char ch);
int mvaddstr(int y, int x, char * str);
int mvprintw(int y, int x, const char * fmt, ...);
int mvinch(int y, int x);
int mvinsch(int y, int x, char ch);
// borders
int box(char vert, char hor);
// erasure
int erase();
int clear();
int clearok(cbool bf);
int clrtobot();
int clrtoeol();
int delch();
int mvdelch(int y, int x);
int deleteln();
// screen control
int scroll();
int scrollok(cbool bf);
int touchwin();
int refresh();
int leaveok(cbool bf);
int flushok(cbool bf);
int standout();
int standend();
// multiple window control
int overlay(CursesWindow &win);
int overwrite(CursesWindow &win);
// traversal support
CursesWindow* child();
CursesWindow* sibling();
CursesWindow* parent();
};
#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
inline int CursesWindow::begx()
{
return w->_begx;
}
inline int CursesWindow::begy()
{
return w->_begy;
}
inline int CursesWindow::maxx()
{
return w->_maxx;
}
inline int CursesWindow::maxy()
{
return w->_maxy;
}
inline int CursesWindow::height()
{
return maxy() - begy() + 1;
}
inline int CursesWindow::width()
{
return maxx() - begx() + 1;
}
inline int CursesWindow::box(char vert, char hor)
{
return ::box(w, vert, hor);
}
inline int CursesWindow::overlay(CursesWindow &win)
{
return ::overlay(w, win.w);
}
inline int CursesWindow::overwrite(CursesWindow &win)
{
return ::overwrite(w, win.w);
}
inline int CursesWindow::scroll()
{
return ::scroll(w);
}
inline int CursesWindow::touchwin()
{
return ::touchwin(w);
}
inline int CursesWindow::addch(const char ch)
{
return ::waddch(w, ch);
}
inline int CursesWindow::addstr(const char * str)
{
return ::waddstr(w, str);
}
inline int CursesWindow::clear()
{
return ::wclear(w);
}
inline int CursesWindow::clrtobot()
{
return ::wclrtobot(w);
}
inline int CursesWindow::clrtoeol()
{
return ::wclrtoeol(w);
}
inline int CursesWindow::delch()
{
return ::wdelch(w);
}
inline int CursesWindow::deleteln()
{
return ::wdeleteln(w);
}
inline int CursesWindow::erase()
{
return ::werase(w);
}
inline int CursesWindow::getch()
{
return ::wgetch(w);
}
inline int CursesWindow::getstr(char * str)
{
return ::wgetstr(w, str);
}
inline int CursesWindow::inch()
{
return winch(w);
}
inline int CursesWindow::insch(char c)
{
return ::winsch(w, c);
}
inline int CursesWindow::insertln()
{
return ::winsertln(w);
}
inline int CursesWindow::move(int y, int x)
{
return ::wmove(w, y, x);
}
inline int CursesWindow::mvcur(int sy, int ey, int sx, int ex)
{
return ::mvcur(sy, ey, sx,ex);
}
inline int CursesWindow::mvaddch(int y, int x, char ch)
{
return (::wmove(w, y, x)==0) ? 0 : ::waddch(w, ch);
}
inline int CursesWindow::mvgetch(int y, int x)
{
return (::wmove(w, y, x)==0) ? 0 : ::wgetch(w);
}
inline int CursesWindow::mvaddstr(int y, int x, char * str)
{
return (::wmove(w, y, x)==0) ? 0 : ::waddstr(w, str);
}
inline int CursesWindow::mvgetstr(int y, int x, char * str)
{
return (::wmove(w, y, x)==0) ? 0 : ::wgetstr(w, str);
}
inline int CursesWindow::mvinch(int y, int x)
{
return (::wmove(w, y, x)==0) ? 0 : ::winch(w);
}
inline int CursesWindow::mvdelch(int y, int x)
{
return (::wmove(w, y, x)==0) ? 0 : ::wdelch(w);
}
inline int CursesWindow::mvinsch(int y, int x, char ch)
{
return (::wmove(w, y, x)==0) ? 0 : ::winsch(w, ch);
}
inline int CursesWindow::refresh()
{
return ::wrefresh(w);
}
inline int CursesWindow::clearok(cbool bf)
{
return ::clearok(w,bf);
}
inline int CursesWindow::leaveok(cbool bf)
{
return ::leaveok(w,bf);
}
inline int CursesWindow::scrollok(cbool bf)
{
return ::scrollok(w,bf);
}
inline int CursesWindow::flushok(cbool bf)
{
return ::flushok(w, bf);
}
inline void CursesWindow::getyx(int& y, int& x)
{
::getyx(w, y, x);
}
inline int CursesWindow::standout()
{
return ::wstandout(w);
}
inline int CursesWindow::standend()
{
return ::wstandend(w);
}
inline int CursesWindow::lines()
{
return LINES;
}
inline int CursesWindow::cols()
{
return COLS;
}
inline CursesWindow* CursesWindow::child()
{
return subwins;
}
inline CursesWindow* CursesWindow::parent()
{
return par;
}
inline CursesWindow* CursesWindow::sibling()
{
return sib;
}
# endif
#endif

View File

@ -1,79 +0,0 @@
// This may look like C code, but it is really -*- C++ -*-
/*
Copyright (C) 1988 Free Software Foundation
written by Dirk Grunwald (grunwald@cs.uiuc.edu)
This file is part of GNU CC.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the GNU CC General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
GNU CC, but only under the conditions described in the
GNU CC General Public License. A copy of this license is
supposed to have been given to you along with GNU CC so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies.
*/
#ifndef _DiscreteUniform_h
#ifdef __GNUG__
#pragma once
#pragma interface
#endif
#define _DiscreteUniform_h 1
#include <Random.h>
//
// The interval [lo..hi)
//
class DiscreteUniform: public Random {
long pLow;
long pHigh;
double delta;
public:
DiscreteUniform(long low, long high, RNG *gen);
long low();
long low(long x);
long high();
long high(long x);
virtual double operator()();
};
#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
inline DiscreteUniform::DiscreteUniform(long low, long high, RNG *gen) : (gen)
{
pLow = (low < high) ? low : high;
pHigh = (low < high) ? high : low;
delta = (pHigh - pLow) + 1;
}
inline long DiscreteUniform::low() { return pLow; }
inline long DiscreteUniform::low(long x) {
long tmp = pLow;
pLow = x;
delta = (pHigh - pLow) + 1;
return tmp;
}
inline long DiscreteUniform::high() { return pHigh; }
inline long DiscreteUniform::high(long x) {
long tmp = pHigh;
pHigh = x;
delta = (pHigh - pLow) + 1;
return tmp;
}
#endif
#endif

View File

@ -1,77 +0,0 @@
// This may look like C code, but it is really -*- C++ -*-
/*
Copyright (C) 1988 Free Software Foundation
written by Dirk Grunwald (grunwald@cs.uiuc.edu)
This file is part of GNU CC.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the GNU CC General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
GNU CC, but only under the conditions described in the
GNU CC General Public License. A copy of this license is
supposed to have been given to you along with GNU CC so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies.
*/
#ifndef _Erlang_h
#ifdef __GNUG__
#pragma once
#pragma interface
#endif
#define _Erlang_h 1
#include <Random.h>
class Erlang: public Random {
protected:
double pMean;
double pVariance;
int k;
double a;
void setState();
public:
Erlang(double mean, double variance, RNG *gen);
double mean();
double mean(double x);
double variance();
double variance(double x);
virtual double operator()();
};
#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
inline void Erlang::setState() {
k = int( (pMean * pMean ) / pVariance + 0.5 );
k = (k > 0) ? k : 1;
a = k / pMean;
}
inline Erlang::Erlang(double mean, double variance, RNG *gen) : (gen)
{
pMean = mean; pVariance = variance;
setState();
}
inline double Erlang::mean() { return pMean; }
inline double Erlang::mean(double x) {
double tmp = pMean; pMean = x; setState(); return tmp;
};
inline double Erlang::variance() { return pVariance; }
inline double Erlang::variance(double x) {
double tmp = pVariance; pVariance = x; setState(); return tmp;
}
#endif
#endif

View File

@ -1,302 +0,0 @@
// This may look like C code, but it is really -*- C++ -*-
/*
Copyright (C) 1988 Free Software Foundation
written by Doug Lea (dl@rocky.oswego.edu)
This file is part of GNU CC.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the GNU CC General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
GNU CC, but only under the conditions described in the
GNU CC General Public License. A copy of this license is
supposed to have been given to you along with GNU CC so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies.
*/
#ifndef _File_h
#ifdef __GNUG__
#pragma once
#pragma interface
#endif
#define _File_h 1
#include <builtin.h>
#include <stdio.h>
#include <stddef.h>
#include <Fmodes.h>
class Filebuf;
class File
{
friend class Filebuf;
protected:
FILE* fp; // _iobuf file pointer
char* nm; // file name (dynamically allocated)
char rw; // 1 = read; 2 = write; 3 = readwrite
// bit 2 (4) means read/write into string
state_value state; // _good/_eof/_fail/_bad
long stat; // last read/write/... return value
void initialize();
void reinitialize(const char*);
char *readline (int chunk_number, char terminator);
public:
File();
File(const char* filename, io_mode m, access_mode a);
File(const char* filename, const char* m);
File(int filedesc, io_mode m);
File(FILE* fileptr);
File(int sz, char* buf, io_mode m);
~File();
// binding, rebinding, unbinding to physical files
File& open(const char* filename, io_mode m, access_mode a);
File& open(const char* filename, const char* m);
File& open(int filedesc, io_mode m);
File& open(FILE* fileptr);
File& close();
File& remove();
// class variable access
int filedesc();
const char* name();
void setname(const char* newname);
int iocount();
int rdstate();
int eof();
int fail();
int bad();
int good();
// other status queries
int readable();
int writable();
int is_open();
operator void*();
// error handling
void error();
void clear(state_value f = _good); // poorly named
void set(state_value f); // set corresponding but
void unset(state_value f); // clear corresponding bit
File& failif(int cond);
void check_state();
// character IO
File& get(char& c);
File& put(char c);
File& unget(char c);
File& putback(char c); // a synonym for unget
// char* IO
File& put(const char* s);
File& get (char* s, int n, char terminator = '\n');
File& getline(char* s, int n, char terminator = '\n');
File& gets (char **s, char terminator = '\n');
// binary IO
File& read(void* x, int sz, int n);
File& write(void* x, int sz, int n);
// formatted IO
File& form(const char* ...);
File& scan(const char* ...);
// buffer IO
File& flush();
// position control
File& seek(long pos, int seek_mode=0); // default seek mode=absolute
long tell();
// buffer control
File& setbuf(int buffer_kind); // legal vals: _IONBF, _IOFBF, _IOLBF
File& setbuf(int size, char* buf);
File& raw();
};
// error handlers
extern void verbose_File_error_handler(const char*);
extern void quiet_File_error_handler(const char*);
extern void fatal_File_error_handler(const char*);
extern one_arg_error_handler_t File_error_handler;
extern one_arg_error_handler_t set_File_error_handler(one_arg_error_handler_t);
#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
inline int File::filedesc()
{
return fileno(fp);
}
inline const char* File::name()
{
return nm;
}
inline int File::iocount()
{
return stat;
}
inline void File::clear(state_value flag)
{
state = flag;
}
inline void File::set(state_value flag)
{
state = state_value(int(state) | int(flag));
}
inline void File::unset(state_value flag)
{
state = state_value(int(state) & ~int(flag));
}
inline int File::readable()
{
if (fp != 0) { if (feof(fp)) set(_eof); if (ferror(fp)) set(_bad);}
return (state == _good && (rw & 01));
}
inline int File::writable()
{
if (fp != 0 && ferror(fp)) set(_bad);
return ((int(state) & (int(_fail)|int(_bad))) == 0 && (rw & 02));
}
inline int File::is_open()
{
return (fp != 0);
}
inline File& File::raw()
{
return this->File::setbuf(_IONBF);
}
inline File& File::failif(int cond)
{
if (cond) set(_fail); return *this;
}
inline File& File::get(char& c)
{
if (readable())
{
int ch = getc(fp);
c = ch;
failif (ch == EOF);
}
return *this;
}
inline File& File::put(char c)
{
return failif (!writable() || putc(c, fp) == EOF);
}
inline File& File::unget(char c)
{
return failif(!is_open() || !(rw & 01) || ungetc(c, fp) == EOF);
}
inline File& File::putback(char c)
{
return failif (!is_open() || !(rw & 01) || ungetc(c, fp) == EOF);
}
inline File& File::read(void* x, int sz, int n)
{
return failif (!readable() || (stat = fread(x, sz, n, fp)) != n);
}
inline File& File::write(void* x, int sz, int n)
{
return failif (!writable() || (stat = fwrite(x, sz, n, fp)) != n);
}
inline File& File::flush()
{
return failif(!is_open() || fflush(fp) == EOF);
}
inline File& File::seek(long pos, int seek_mode)
{
return failif (!is_open() || fseek(fp, pos, seek_mode) < 0);
}
inline long File::tell()
{
failif (!is_open() || ((stat = ftell(fp)) < 0));
return stat;
}
inline int File::rdstate()
{
check_state(); return state; // check_state is necessary in rare but
} // possible circumstances
inline File::operator void*()
{
check_state(); return (int(state) & (int(_bad)|int(_fail)))? 0 : this ;
}
inline int File::eof()
{
check_state(); return state & _eof;
}
inline int File::fail()
{
check_state(); return state & _fail;
}
inline int File::bad()
{
check_state(); return state & _bad;
}
inline int File::good()
{
check_state(); return rdstate() == _good;
}
#endif
#endif

View File

@ -1,32 +0,0 @@
// This may look like C code, but it is really -*- C++ -*-
/*
Copyright (C) 1988 Free Software Foundation
written by Doug Lea (dl@rocky.oswego.edu)
This file is part of GNU CC.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY. No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing. Refer to the GNU CC General Public
License for full details.
Everyone is granted permission to copy, modify and redistribute
GNU CC, but only under the conditions described in the
GNU CC General Public License. A copy of this license is
supposed to have been given to you along with GNU CC so you
can know your rights and responsibilities. It should be in a
file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies.
*/
#ifndef _Filebuf_h
#ifdef __GNUG__
#pragma once
#pragma interface
#endif
#define _Filebuf_h 1
#endif

Some files were not shown because too many files have changed in this diff Show More