1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
|
\input texinfo @c -*-texinfo-*-
@c "@(#)$Name$:$Id$"
@c Documentation for Chess.el.
@c Copyright (C) 2001, 2002 John Wiegley.
@c This file is free software; you can redistribute it and/or modify it
@c under the terms of the GNU General Public License as published by the
@c Free Software Foundation; either version 2 of the License, or (at
@c your option) any later version.
@c This file is distributed in the hope that it will be useful, but
@c WITHOUT ANY WARRANTY; without even the implied warraonty of
@c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@c General Public License for more details.
@c You should have received a copy of the GNU General Public License
@c along with Eshell; see the file COPYING. If not, write to the Free
@c Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
@c %**start of header
@setfilename chess.info
@settitle Emacs Chess: chess.el
@c %**end of header
@dircategory Emacs
@direntry
* Chess: (chess). Chess.el is an Emacs chess client.
@end direntry
@setchapternewpage on
@ifinfo
Copyright @copyright{} 2001, 2002 John Wiegley.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation.
@end ifinfo
@synindex vr fn
@c The titlepage section does not appear in the Info file.
@titlepage
@sp 4
@c The title is printed in a large font.
@center @titlefont{User's Guide}
@sp
@center @titlefont{to}
@sp
@center @titlefont{Emacs Chess: chess.el}
@ignore
@sp 2
@center release 2.0
@c -release-
@end ignore
@sp 3
@center John Wiegley
@c -date-
@c The following two commands start the copyright page for the printed
@c manual. This will not appear in the Info file.
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 2001, 2002 John Wiegley.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation.
@end titlepage
@contents
@c ================================================================
@c The real text starts here
@c ================================================================
@ifinfo
@node Top, Emacs Chess: chess.el, (dir), (dir)
@top Emacs Chess: chess.el
Chess.el is an Emacs chess client and library, designed to be used for
writing chess-related programs, or for playing games of chess against
various chess engines, including Internet servers. The library can be
used for analyzing variations, browsing historical games, or a
multitude of other purposes.
The purpose of this manual is to help you understand how Chess.el is
structured for use as a library, and also how to use it as a client.
@end ifinfo
@chapter The chess.el library
@cindex library
@section Positions
A chess @dfn{position} is a given layout of pieces on a chess board,
reflecting also which side is next to move, and what privileges are
currently available to each side (castling short or long, en passant
capture, etc).
A position may be represented in ASCII using FEN notation, or
graphically by displaying a chess board. It is rather inconvenient to
render them verbally.
The position can be represented on a remote terminal using X windows, or
by transmitting the FEN string via a network connection, or clipboard,
to another chess board rendering tool. It may of course also be
represented physically, by setting up the pieces to match the FEN
notation.
Chess puzzles are most often provided as a set of positions.
@subsection Creating positions
@c lispfun chess-pos-create
@c lispfun chess-pos-copy
@defvar chess-starting-position
@end defvar
@subsection Position coordinates
@c lispfun chess-index-rank
@c lispfun chess-index-file
@c lispfun chess-rf-to-index
@c lispfun chess-coord-to-index
@c lispfun chess-index-to-coord
@c lispfun chess-incr-index
@subsection Position details
@c lispfun chess-pos-piece
@c lispfun chess-pos-piece-p
@c lispfun chess-pos-set-piece
@c lispfun chess-pos-search
@c lispfun chess-search-position
@c lispfun chess-pos-can-castle
@c lispfun chess-pos-set-can-castle
@c lispfun chess-pos-en-passant
@c lispfun chess-pos-set-en-passant
@c lispfun chess-pos-status
@c lispfun chess-pos-set-status
@c lispfun chess-pos-side-to-move
@c lispfun chess-pos-set-side-to-move
@c lispfun chess-pos-move
Missing documentation for 'chess-pos-move'
@subsection Annotations
@c lispfun chess-pos-annotations
@c lispfun chess-pos-add-annotation
@subsection FEN notation
@c lispfun chess-fen-to-pos
@c lispfun chess-pos-to-fen
@section Plies
A @dfn{ply} is the differential between two positions. Or, it is the
coordinate transformations applied to one position in order to arrive at
the following position. It is also informally called "a move".
A ply may be represented in ASCII by printing the FEN string of the base
position, and then printing the positional transformation in algebraic
notation. Since the starting position is usually known, the FEN string
is optional. A ply may be represented graphically by moving the chess
piece(s) involved. It may be rendered verbally by voicing which piece
is to move, where it will move to, and what will happen a result of the
move (piece capture, check, etc).
Plies may be sent over network connections, postal mail, e-mail, etc.,
so long as the current position is maintained at both sides.
Transmitting the base position's FEN string along with the ply offers a
form of confirmation during the course of a game.
@subsection Creating plies
@c lispfun chess-ply-create
@c lispfun chess-legal-plies
@subsection Ply details
@c lispfun chess-ply-pos
@c lispfun chess-ply-set-pos
@c lispfun chess-ply-changes
@c lispfun chess-ply-set-changes
@subsection The "next" position
@c lispfun chess-ply-next-pos
@c lispfun chess-ply-final-p
@subsection Algebraic notation
@c lispfun chess-ply-to-algebraic
@c lispfun chess-algebraic-to-ply
@defvar chess-algebraic-regexp
@end defvar
@section Variations
A @dfn{variation} is a sequence of plies that occur after some starting
position. If the starting position represents the initial setup of a
chess board, and if the final ply results in completion of the game, it
is called the "main variation". Otherwise, variations typically
represented interesting tangents during a game---but not actually
played---as envisioned by the player, an annotator, or someone studying
the game.
Variations may be represented in ASCII by stating the FEN string for
starting position, followed by the list of plies that follow that
position. They are difficult to represent graphically, except for
showing each position in turn with a slight pause between---or by
allowing the user to navigate each of the subsequent positions in turn.
They may be represented verbally by announcing each of the plies in
turn, as mentioned above.
@subsection Creating variations
@c lispfun chess-var-create
@subsection Variation positions
@c lispfun chess-var-pos
@c lispfun chess-var-index
@c lispfun chess-var-seq
@c lispfun chess-var-side-to-move
@subsection Varation plies
@c lispfun chess-var-ply
@subsection Making a move in a variation
@c lispfun chess-var-move
@c lispfun chess-var-add-ply
@c lispfun chess-var-plies
@section Games
A @dfn{game} includes its main variation, incidental information about
the game (who played it, where, when, who won, etc), and any
sub-variations of interest to those studying the game afterwards.
Where TAGS is an alist that associates arbitrary English tag names to
their values.
A game may be represented in ASCII using standard PGN notation.
Representing them graphically or verbally is similar to what is done
for variations.
@c lispfun chess-game-add-hook
@c lispfun chess-game-add-ply
@c lispfun chess-game-hooks
@c lispfun chess-game-plies
@c lispfun chess-game-remove-hook
@c lispfun chess-game-run-hooks
@c lispfun chess-game-set-hooks
@c lispfun chess-game-set-plies
@subsection Creating games
@c lispfun chess-game-create
@subsection Game tags
@c lispfun chess-game-tags
@c lispfun chess-game-set-tags
@c lispfun chess-game-tag
@c lispfun chess-game-set-tag
@c lispfun chess-game-del-tag
@subsection Game positions
@c lispfun chess-game-pos
@c lispfun chess-game-index
@c lispfun chess-game-seq
@c lispfun chess-game-side-to-move
@subsection Game plies
@c lispfun chess-game-ply
@subsection Making a move
@c lispfun chess-game-move
@subsection PGN notation
@c lispfun chess-pgn-to-game
@c lispfun chess-game-to-pgn
@c lispfun chess-pgn-insert-plies
@subsubsection PGN mode
@section Collections
A @dfn{collection} is a set of games archived for later perusal. A set
of games conceptually represents a large tree of branching variations,
and can be used for studying current theory, examining Master
preferences, etc.
Chess.el itself does not attempt to provide library services, or does it
ever represent library collections in memory. Instead, it interacts
with a chess database engine for the purpose of storing and retrieving
games from the library, or performing library-wide analyses and
searches.
@chapter Displays
The previous chapter described all the objects found in
chess---positions, plies, variations, games and collections. However,
these objects can only be manipulated programmitically using the
functions given so far. In order to present them in a meaningful
fashion to a human reader, it is necessary to create and use a display
object.
@c lispfun chess-display-create
@c lispfun/c chess-display-destroy
@chapter Chessboard displays
@c lispfun chess-display-active-p
@c lispfun chess-display-clear-board
@c lispfun chess-display-game
@c lispfun chess-display-highlight
@c lispfun chess-display-index
@c lispfun chess-display-invert
@c lispfun chess-display-move
@c lispfun chess-display-move-backward
@c lispfun chess-display-move-first
@c lispfun chess-display-move-forward
@c lispfun chess-display-move-last
@c lispfun chess-display-perspective
@c lispfun chess-display-ply
@c lispfun chess-display-position
@c lispfun chess-display-quit
@c lispfun chess-display-set-game
@c lispfun chess-display-set-index
@c lispfun chess-display-set-perspective
@c lispfun chess-display-set-ply
@c lispfun chess-display-set-position
@c lispfun chess-display-set-variation
@c lispfun chess-display-update
@c lispfun chess-display-variation
@chapter Engines
@c lispfun chess-engine-create
@c lispfun chess-engine-set-option
@c lispfun/c chess-engine-destroy
@c lispfun chess-engine-set-position
@c lispfun chess-engine-position
@c lispfun chess-engine-set-game
@c lispfun chess-engine-game
@c lispfun chess-engine-index
@c lispfun chess-engine-move
@c lispfun chess-engine-command
@c lispfun chess-engine-send
@unnumbered Concept Index
@printindex cp
@unnumbered Function and Variable Index
@printindex fn
@unnumbered Key Index
@printindex ky
@bye
|