Trailing-Edge
-
PDP-10 Archives
-
mit_emacs_170_teco_1220
-
emacs/chess.emacs
There are no other files named chess.emacs in the archive.
!* -*- TECO -*- !
!* Reconstructed from sourceless library file. Use IVORY to re-compile this.!
!~FILENAME~:! !Chess board -*-TECO-*- macros.!
CHESS
!Chess Moves:! !C Mode to move pieces.
It will ask whose move is first; type W or B.
ARG (1) is move number started from.
Move from: type board position, e.g. KB7 or QN2, of the color moving.
Move to: type board position.
If a piece is captured, it will be placed to the right of the board.
Captured pieces are separated by commas (must be).!
:i*Chess Moves[..j
-:s
"E bj'
s|- l
6l
f+ @v
[.1
@ft
Whose move? fi:@fc-W"E @ftWhite.
:i.1White'
"# @ftBlack.
:i.1Black'
[.2
[.3
ff"E 1'"# ':\[.4
f<!Move from!
m(m.m& Chess Read Position).4. Move from .1: u.2
q.2"E 1;'
q.1,q.2m(m.m& Chess Position Cursor)
30:w
.u.2
m(m.m& Chess Read Position).4. Move to .1: u.3
q.3"E oMove from'
q.1,q.3m(m.m& Chess Position Cursor)
30:w
.u.3
q.2,q.3m(m.m& Chess One Move)
f=.1White"E :i.1Black'
"# :i.1White
.4+1 :\u.4'
>
!& Chess Position Cursor:! !S Put cursor at KB3, QN5, etc.
Numarg1 is string pointer for whose move.
Numarg2 is string pointer for the position.
Assumes white is at bottom.!
[.1
[.2
-:s
"E bj'
s|- l
f=.1White"E 14l'
0,1:g.2[.3
1,2:g.2[.4
0[.5
f~.4B"E 1u.5'
f~.4N"E 2u.5'
f~.4R"E 3u.5'
f~.3Q"E 10-(3*q.5)c'
f~.3K"E 13+(3*q.5)c'
fshposu.3
fq.2-2"G 2,3:g.2u.4'
f=.1White"E
-2*(.4-1)l'
f=.1Black"E
2*(.4-1)l'
q.3c
@v
!& Chess One Move:! !S Edit one move, from numarg1 point to numarg2 point.
Captures placed at right of board, separated by commas (must be).!
[.1
[.2
q.1j 2 fx*[.3 i
q.2j
2 fx*[.4
g.3
f=.4 "N
-:s
"E bj'
s|- l
f=.4W+1"E
14l'
:l 0a-|"E i '
"# i,'
i.4
'
q.2j
@v
!& Chess Read Position:! !S Read line, verify legal position or repeat.
String arg is prompt string.
Returns string pointer that & Read Line returns.!
:i*[.1
[.2
[.3
14.fs rereadw
f<!Valid Position!
< 1,m(m.m& Read Line).1u.2
q.2"E f;Valid Position'
fq.2-3"G ft
Positions 3 letters max, of form: <Q/K> {<R/N/B>} <#>
1;'
fq.2-2"L ft
Positions 2 letters min, of form: <Q/K> {<R/N/B>} <#>
1;'
0,1:g.2u.3
f~.3Q"N f~.3K"N ft
Positions start with Q or K, of form: <Q/K> {<R/N/B>} <#>
1;''
1,2:g.2u.3
.3 fRNBrnb12345678"L ft
Positions have second letter R, N, B, or 1-8, of from: <Q/K> {<R/N/B>} <#>
1;'
fq.2-3"E 2,3:g.2u.3
.3 f12345678"L ft
Positions have optional third letter 1-8, of form: <Q/K> {<R/N/B>} <#>
1;''
f;Valid Position
>
>
q.2
!Chess Board:! !C Insert a new board.!
fs hpos"G i
'
i
|-----------------------|
|BR|BN|BB|BQ|BK|BB|BN|BR|
|--|--|--|--|--|--|--|--|
|BP|BP|BP|BP|BP|BP|BP|BP|
|--|--|--|--|--|--|--|--|
| | | | | | | | |
|--|--|--|--|--|--|--|--|
| | | | | | | | |
|--|--|--|--|--|--|--|--|
| | | | | | | | |
|--|--|--|--|--|--|--|--|
| | | | | | | | |
|--|--|--|--|--|--|--|--|
|WP|WP|WP|WP|WP|WP|WP|WP|
|--|--|--|--|--|--|--|--|
|WR|WN|WB|WQ|WK|WB|WN|WR|
|-----------------------|
GAME
1.
-14l
!Chess Reset:! !C Delete this board and make new one.!
-:s
"E bj'
.,(c :s
"E zj'). k
m(m.mChess Board)
!Chess Compile:! !C Make buffer of boards into xgp chess boards.!
bj
< 0,fs z fs boundw
:s
"E 1;'
:s|"E 1;' 0l
.,(:s
"E zj'
-sGAME 0l). fs boundw
bj < :s-|; -d >
bj < :s
; -2d >
bj k
bj <:sWK; @>
bj <:sWQ; B>
bj <:sWR; D>
bj <:sWB; F>
bj <:sWN; H>
bj <:sWP; J>
bj <:sBK; `>
bj <:sBQ; b>
bj <:sBR; d>
bj <:sBB; f>
bj <:sBN; h>
bj <:sBP; j>
bj <:s,; -d>
bj <:s ; 0>
bj 4< 4< c 1a+1i d>
l
4< 1a+1i d c>
l
>
bj i2333333334
8< 0l i9 8c i5 l>
i8777777776
bj i.select 1
zj i.select 0
>
0,fs z fs boundw
bji.xgp
.font 1 S50CHS
.font 0 25FGB1
.nofill
.vsp 0
.nohead
bj <:s
; .page
>
bj :s.page