]> code.delx.au - gnu-emacs-elpa/blob - chess.info
Release 2.0.4
[gnu-emacs-elpa] / chess.info
1 This is chess.info, produced by makeinfo version 5.2 from chess.texi.
2
3 Copyright © 2001, 2002, 2004, 2014 Free Software Foundation, Inc.
4
5 Permission is granted to copy, distribute and/or modify this
6 document under the terms of the GNU Free Documentation License,
7 Version 1.3 or any later version published by the Free Software
8 Foundation; with no Invariant Sections, with the Front-Cover Texts
9 being “A GNU Manual,” and with the Back-Cover Texts as in (a)
10 below. A copy of the license is included in the section entitled
11 “GNU Free Documentation License.”
12
13 (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and
14 modify this GNU manual.”
15 INFO-DIR-SECTION Emacs
16 START-INFO-DIR-ENTRY
17 * Chess: (chess). Chess.el is an Emacs chess client.
18 END-INFO-DIR-ENTRY
19
20 Copyright © 2001, 2002, 2004, 2014 Free Software Foundation, Inc.
21
22 Permission is granted to copy, distribute and/or modify this
23 document under the terms of the GNU Free Documentation License,
24 Version 1.3 or any later version published by the Free Software
25 Foundation; with no Invariant Sections, with the Front-Cover Texts
26 being “A GNU Manual,” and with the Back-Cover Texts as in (a)
27 below. A copy of the license is included in the section entitled
28 “GNU Free Documentation License.”
29
30 (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and
31 modify this GNU manual.”
32
33 \1f
34 File: chess.info, Node: Top, Next: The chess.el library
35
36 Emacs Chess: chess.el
37 *********************
38
39 ‘Chess.el’ is an Emacs chess client and library, designed to be used for
40 writing chess-related programs, or for playing games of chess against
41 various chess engines, including Internet servers. The library can be
42 used for analyzing variations, browsing historical games, or a multitude
43 of other purposes.
44
45 The purpose of this manual is to help you understand how ‘chess.el’
46 is structured for use as a library, and also how to use it as a client.
47
48 * Menu:
49
50 * The chess.el library:: Basic objects required to deal with Chess
51 * Modules:: The module-system explained
52 * Chessboard displays:: Different types of chessboards in a buffer
53 * Engines:: Internal and external chess-playing engines
54 * Chess Session:: Tying it all together
55 * Internet Chess Servers:: Playing chess with other people
56 * GNU Free Documentation License::
57 * Concept Index::
58 * Function and Variable Index::
59 * Key Index::
60
61 \1f
62 File: chess.info, Node: The chess.el library, Next: Modules, Up: Top
63
64 1 The ‘chess.el’ library
65 ************************
66
67 This chapter documents the low-level aspects of ‘chess.el’, mostly
68 targeting developers interested in understanding the underlying APIs.
69
70 *Note Chessboard displays::, and the chapters following it, if you
71 are interested in the more user-visible aspects of ‘chess.el’.
72
73 * Menu:
74
75 * Positions::
76 * Plies::
77 * Variations::
78 * Games::
79 * Collections::
80 * Chess Opening Books::
81
82 \1f
83 File: chess.info, Node: Positions, Next: Plies, Up: The chess.el library
84
85 1.1 Positions
86 =============
87
88 A chess "position" is a given layout of pieces on a chess board, also
89 reflecting which "side" (i.e., player) is next to move, and what
90 privileges are currently available to each side (castling short or long,
91 en passant capture, etc).
92
93 A position may be represented in ASCII using FEN (or EPD), or
94 graphically by displaying a chess board. It is rather inconvenient to
95 render them verbally.
96
97 The position can be represented on a remote terminal using X windows,
98 or by transmitting the FEN string via a network connection or clipboard,
99 to another chess board rendering tool. It may of course also be
100 represented physically, by setting up the pieces to match the FEN
101 specification.
102
103 Chess puzzles are most often provided as a set of positions.
104
105 * Menu:
106
107 * Creating positions::
108 * Position coordinates::
109 * Position details::
110 * Annotations::
111 * FEN notation::
112 * EPD notation::
113
114 \1f
115 File: chess.info, Node: Creating positions, Next: Position coordinates, Up: Positions
116
117 1.1.1 Creating positions
118 ------------------------
119
120 -- Function: chess-pos-create &optional blank
121 Create a new chess position, set at the starting position. If
122 BLANK is non-‘nil’, all of the squares will be empty. The current
123 side-to-move is always white.
124
125 -- Function: chess-pos-copy position
126 Copy the given chess POSITION. If there are annotations or EPD
127 opcodes set, these lists are copied as well, so that the two
128 positions do not share the same lists.
129
130 -- Variable: chess-starting-position
131 Starting position of a chess game.
132
133 -- Function: chess-fischer-random-position
134 Generate a Fischer Random style position.
135
136 \1f
137 File: chess.info, Node: Position coordinates, Next: Position details, Prev: Creating positions, Up: Positions
138
139 1.1.2 Position coordinates
140 --------------------------
141
142 First of all, position coordinates use a coordinate system of octal
143 indices, where the index ‘?\044’ signifies rank 4 file 4 (i.e., "e4").
144 Rank is numbered 0 to 7, top to bottom, and file is 0 to 7, left to
145 right.
146
147 -- Function: chess-index-rank index
148 Return the rank component of the given INDEX.
149
150 -- Function: chess-index-file index
151 Return the file component of the given INDEX.
152
153 -- Function: chess-rf-to-index rank file
154 Convert RANK and FILE coordinates into an octal index.
155
156 For those who wish to use ASCII coordinates, such as "e4", there are
157 two conversion functions:
158
159 -- Function: chess-coord-to-index coord
160 Convert a COORD string into an index value.
161
162 -- Function: chess-index-to-coord index
163 Convert the chess position INDEX into a coord string.
164
165 For fast manipulation of chess position indices, the following
166 constants and functions are provided:
167
168 For queens and rooks:
169
170 -- Constant: chess-direction-north
171 Signify one step north, as seen from the perspective of the white
172 player.
173
174 -- Constant: chess-direction-east
175 Signify one step east, as seen from the perspective of the white
176 player.
177
178 -- Constant: chess-direction-south
179 Signify one step south, as seen from the perspective of the white
180 player.
181
182 -- Constant: chess-direction-west
183 Signify one step west, as seen from the perspective of the white
184 player.
185
186 For queens and bishops:
187
188 -- Constant: chess-direction-northeast
189 Signify one step northeast, as seen from the perspective of the
190 white player.
191
192 -- Constant: chess-direction-southeast
193 Signify one step southeast, as seen from the perspective of the
194 white player.
195
196 -- Constant: chess-direction-southwest
197 Signify one step southwest, as seen from the perspective of the
198 white player.
199
200 -- Constant: chess-direction-northwest
201 Signify one step northwest, as seen from the perspective of the
202 white player.
203
204 -- Function: chess-next-index index direction
205 Create a new INDEX from an old one, by advancing it into DIRECTION.
206 If the resulting index is not valid (outside the board), ‘nil’ is
207 returned.
208
209 Due to the underlying technique used to efficiently detect off-board
210 squares, a direction specifier should at most do two steps in any
211 direction. Directions can be combined, so that ‘(*
212 chess-direction-north 2)’ will give a typical initial white pawn push.
213
214 \1f
215 File: chess.info, Node: Position details, Next: Annotations, Prev: Position coordinates, Up: Positions
216
217 1.1.3 Position details
218 ----------------------
219
220 Given an octal index value, you can look up what’s on a particular
221 square, or set that square’s value:
222
223 -- Function: chess-pos-piece position index
224 Return the piece on POSITION at INDEX.
225
226 -- Function: chess-pos-piece-p position index piece-or-color
227 Return non-‘nil’ if the given PIECE-OR-COLOR is at POSITION/INDEX.
228 If PIECE-OR-COLOR is ‘t’ for white or ‘nil’ for black, any piece of
229 that color will do.
230
231 -- Function: chess-pos-set-piece position index piece
232 Set the piece on POSITION at INDEX to PIECE. PIECE must be one of
233 ‘?K’, ‘?Q’, ‘?N’, ‘?B’, ‘?R’, or ‘?P’ for white pieces, or one of
234 the corresponding lowercase letters for black pieces.
235
236 -- Function: chess-pos-search position piece-or-color
237 Look anywhere on POSITION for PIECE-OR-COLOR, returning all
238 coordinates. If PIECE-OR-COLOR is ‘t’ for white or ‘nil’ for
239 black, any piece of that color will do.
240
241 -- Function: chess-pos-search* position &rest pieces
242 Look on POSITION for any of PIECES.
243
244 The result is an alist where each element looks like
245 ‘(PIECE . INDICES)’. Pieces which did not appear in POSITION will
246 be present in the resulting alist, but the ‘cdr’ of their entries
247 will be ‘nil’.
248
249 -- Function: chess-search-position position target piece &optional
250 check-only no-castling
251 Look on POSITION from TARGET for a PIECE that can move there. This
252 routine looks along valid paths of movement for PIECE. It differs
253 from ‘chess-pos-search’, which is a more basic function that
254 doesn’t take piece movement into account.
255
256 If PIECE is ‘t’ or ‘nil’, valid piece movements for any piece of
257 that color will be considered (‘t’ for white, ‘nil’ for black).
258 Otherwise, the letter-case of the PIECE determines color.
259
260 The return value is a list of candidates, which means a list of
261 indices that indicate where a piece may have moved from.
262
263 If CHECK-ONLY is non-‘nil’ and PIECE is either ‘t’ or ‘nil’, only
264 consider pieces which can give check (not the opponent’s king). If
265 NO-CASTLING is non-‘nil’, do not consider castling moves.
266
267 -- Function: chess-pos-can-castle position side
268 Return whether the king on POSITION can castle on SIDE. The SIDE
269 argument must be either ‘?K’ for the king side, or ‘?Q’ for the
270 queen side (use lowercase to query if black can castle).
271
272 -- Function: chess-pos-set-can-castle position side value
273 Set whether the king can castle on the given POSITION on SIDE.
274
275 See ‘chess-pos-can-castle’.
276
277 It is only necessary to call this function if setting up a position
278 manually. Note that all newly created positions have full castling
279 privileges set, unless the position is created blank, in which case
280 castling privileges are unset. See ‘chess-pos-create’.
281
282 -- Function: chess-pos-en-passant position
283 Return the index of any pawn on POSITION that can be captured en
284 passant. Returns ‘nil’ if en passant is unavailable.
285
286 -- Function: chess-pos-set-en-passant position index
287 Set the index of any pawn on POSITION that can be captured en
288 passant.
289
290 -- Function: chess-pos-status position
291 Return whether the side to move in the POSITION is in a special
292 state. Return ‘nil’ if not, otherwise one of the keywords:
293 ‘:check’, ‘:checkmate’ or ‘:stalemate’.
294
295 -- Function: chess-pos-set-status position value
296 Set whether the side to move in POSITION is in a special state.
297 The VALUE should either be ‘nil’, to indicate that the POSITION is
298 normal, or one of the symbols: ‘check’, ‘checkmate’, ‘stalemate’.
299
300 -- Function: chess-pos-side-to-move position
301 Return the color whose move it is in POSITION.
302
303 -- Function: chess-pos-set-side-to-move position color
304 Set the color whose move it is in POSITION.
305
306 -- Function: chess-pos-passed-pawns position color &optional
307 pawn-indices
308 If COLOR has Passed Pawns in POSITION, return a list of their
309 indices. Optionally, if INDICES is non-‘nil’, those indices are
310 considered as candidates.
311
312 A Pawn whose advance to the eighth rank is not blocked by an
313 opposing Pawn in the same file and who does not have to pass one on
314 an adjoining file is called a passed Pawn.
315
316 -- Variable: chess-pos-always-white
317 When set, it is assumed that white is always on move. This is
318 really only useful when setting up training positions. This
319 variable automatically becomes buffer-local when changed.
320
321 -- Function: chess-pos-move position &rest changes
322 Move a piece on the POSITION directly, using the indices in
323 CHANGES. This function does not check any rules, it only makes
324 sure you are not trying to move a blank square.
325
326 \1f
327 File: chess.info, Node: Annotations, Next: FEN notation, Prev: Position details, Up: Positions
328
329 1.1.4 Annotations
330 -----------------
331
332 -- Function: chess-pos-annotations position
333 Return the list of annotations for this position.
334
335 -- Function: chess-pos-add-annotation position annotation
336 Add an annotation for this position.
337
338 \1f
339 File: chess.info, Node: FEN notation, Next: EPD notation, Prev: Annotations, Up: Positions
340
341 1.1.5 FEN notation
342 ------------------
343
344 "FEN" (Forsyth-Edwards Notation) encodes a chess position using a simple
345 string. The format is:
346
347 POSITION SIDE CASTLING EN-PASSANT
348
349 The POSITION gives all eight ranks, by specifying a letter for each
350 piece in the position, and a number for any intervening spaces; ranks
351 are separated by slashes. Trailing spaces need not be counted.
352 Uppercase letters signify white pieces, and lowercase black. For
353 example, if your position only had a black king on d8, your POSITION
354 string would be:
355
356 3k////////
357
358 for the three spaces (a, b and c file), the black king, and then all the
359 remaining ranks (which are all empty, so their spaces can be ignored).
360
361 The SIDE is ‘w’ or ‘b’, to indicate whose move it is.
362
363 The CASTLING can contain ‘K’, ‘Q’, ‘k’ or ‘q’, to signify whether the
364 white or black king can still castle on the king or queen side. If
365 neither color can castle on any side, ‘-’ should be provided.
366
367 The EN-PASSANT signifies the target square of an en passant capture,
368 such as ‘e3’ or ‘a6’.
369
370 -- Function: chess-fen-to-pos fen
371 Convert the FEN string FEN to a chess position.
372
373 -- Function: chess-pos-to-fen position &optional full
374 Convert a chess POSITION to a FEN string. If FULL is non-‘nil’,
375 represent trailing spaces as well.
376
377 This is how the starting position looks like:
378
379 (chess-pos-to-fen chess-starting-position)
380 ⇒ "rnbqkbnr/pppppppp/////PPPPPPPP/RNBQKBNR w KQkq -"
381
382 Some external programs might have problems parsing terse FEN strings.
383 If you are unsure, use the more verbose form:
384
385 (chess-pos-to-fen chess-starting-position t)
386 ⇒ "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -"
387
388 \1f
389 File: chess.info, Node: EPD notation, Prev: FEN notation, Up: Positions
390
391 1.1.6 EPD notation
392 ------------------
393
394 "EPD" (Extended Position Description) is a standard for describing chess
395 positions along with an extended set of structured attribute values
396 using the ASCII character set. It is intended for data and command
397 interchange among chess-playing programs. It is also intended for the
398 representation of portable opening library repositories.
399
400 A single EPD uses one text line of variable length composed of four
401 data fields, followed by zero or more operations. The four fields of
402 the EPD specification are the same as the first four fields of the FEN
403 specification (*note FEN notation::).
404
405 A text file composed exclusively of EPD data records should have a
406 file name with the ‘.epd’ extension.
407
408 -- Function: chess-epd-to-pos &optional string
409 Convert extended position description STRING to a chess position.
410 If STRING is not specified, look for an EPD string in the current
411 buffer, and advance point after the correctly parsed position.
412
413 -- Function: chess-pos-to-epd position
414 Convert a chess POSITION to a string representation in extended
415 position description format.
416
417 -- Function: chess-epd-read-file file
418 Return a list of positions contained in FILE.
419
420 * Menu:
421
422 * Operations::
423 * Opcode "acd" analysis count depth::
424 * Opcode "acn" analysis count nodes::
425 * Opcode "acs" analysis count seconds::
426 * Opcode "am" avoid move(s)::
427 * Opcode "bm" best move(s)::
428
429 \1f
430 File: chess.info, Node: Operations, Next: Opcode "acd" analysis count depth, Up: EPD notation
431
432 1.1.6.1 Operations
433 ..................
434
435 An EPD operation is composed of an opcode followed by zero or more
436 operands, and terminated by a semicolon.
437
438 Multiple operations are separated by a single space character. If
439 there is at least one operation present in an EPD record, it is
440 separated from the last (fourth) data field by a single space character.
441
442 Some opcodes that allow for more than one operand may have special
443 ordering requirements for the operands. For example, the ‘pv’
444 (predicted variation) opcode requires its operands (moves) to appear in
445 the order in which they would be played. All other opcodes that allow
446 for more than one operand should have operands appearing in ASCII order.
447 An example of the latter set is the ‘bm’ (best move[s]) opcode; its
448 operands are moves that are all immediately playable from the current
449 position.
450
451 \1f
452 File: chess.info, Node: Opcode "acd" analysis count depth, Next: Opcode "acn" analysis count nodes, Prev: Operations, Up: EPD notation
453
454 1.1.6.2 Opcode ‘acd’ analysis count depth
455 .........................................
456
457 The opcode ‘acd’ takes a single non-negative integer operand. It is
458 used to represent the depth of the ply (*note Plies::) examined in an
459 analysis.
460
461 \1f
462 File: chess.info, Node: Opcode "acn" analysis count nodes, Next: Opcode "acs" analysis count seconds, Prev: Opcode "acd" analysis count depth, Up: EPD notation
463
464 1.1.6.3 Opcode ‘acn’ analysis count nodes
465 .........................................
466
467 The opcode ‘acn’ takes a single non-negative integer operand. It is
468 used to represent the number of nodes examined in an analysis. Note
469 that the value may be quite large for some extended searches, and so use
470 of (at least) a long (four byte) representation is suggested.
471
472 \1f
473 File: chess.info, Node: Opcode "acs" analysis count seconds, Next: Opcode "am" avoid move(s), Prev: Opcode "acn" analysis count nodes, Up: EPD notation
474
475 1.1.6.4 Opcode ‘acs’ analysis count seconds
476 ...........................................
477
478 The opcode ‘acs’ takes a single non-negative integer operand. It is
479 used to represent the number of seconds used for an analysis. Note that
480 the value may be quite large for some extended searches, and so use of
481 (at least) a long (four byte) representation is suggested.
482
483 \1f
484 File: chess.info, Node: Opcode "am" avoid move(s), Next: Opcode "bm" best move(s), Prev: Opcode "acs" analysis count seconds, Up: EPD notation
485
486 1.1.6.5 Opcode ‘am’ avoid move(s)
487 .................................
488
489 The opcode ‘am’ indicates a set of zero or more moves, all immediately
490 playable from the current position, that are to be avoided in the
491 opinion of the EPD writer. Each operand is a SAN move; they appear in
492 ASCII order.
493
494 \1f
495 File: chess.info, Node: Opcode "bm" best move(s), Prev: Opcode "am" avoid move(s), Up: EPD notation
496
497 1.1.6.6 Opcode ‘bm’ best move(s)
498 ................................
499
500 The opcode ‘bm’ indicates a set of zero or more moves, all immediately
501 playable from the current position, that are judged to the best
502 available by the EPD writer. Each operand is a SAN move; they appear in
503 ASCII order.
504
505 \1f
506 File: chess.info, Node: Plies, Next: Variations, Prev: Positions, Up: The chess.el library
507
508 1.2 Plies
509 =========
510
511 A "ply" is the differential between two positions. In other words, it
512 is the coordinate transformations applied to one position in order to
513 arrive at the following position. It is also informally called "a
514 move".
515
516 A ply may be represented in ASCII by printing the FEN string of the
517 base position, and then printing the positional transformation in
518 algebraic notation. Since the starting position is usually known, the
519 FEN string is optional. A ply may be represented graphically by moving
520 the chess piece(s) involved. It may be rendered verbally by voicing
521 which piece is to move, where it will move to, and what will happen a
522 result of the move (piece capture, check, etc).
523
524 Plies may be sent over network connections, postal mail, e-mail,
525 etc., so long as the current position is maintained at both sides.
526 Transmitting the base position’s FEN string along with the ply offers a
527 form of confirmation during the course of a game.
528
529 * Menu:
530
531 * Creating plies::
532 * Ply details::
533 * The "next" position::
534 * Algebraic notation::
535
536 \1f
537 File: chess.info, Node: Creating plies, Next: Ply details, Up: Plies
538
539 1.2.1 Creating plies
540 --------------------
541
542 -- Function: chess-ply-create position &optional valid-p &rest changes
543 Create a ply from the given POSITION by applying the supplied
544 CHANGES. This function will guarantee the resulting ply is valid,
545 and will also annotate the ply with ‘:check’ or other modifiers as
546 necessary. It will also extend castling, and will prompt for a
547 promotion piece.
548
549 Note: Do not pass in the rook move if CHANGES represents a castling
550 maneuver.
551
552 -- Function: chess-legal-plies position &rest keywords
553 Return a list of all valid plies in POSITION. The allowed KEYWORDS
554 are:
555
556 ‘:any’
557 Return ‘t’ if any piece can move at all.
558
559 ‘:color BOOLEAN’
560 If BOOLEAN is ‘t’, return plies for white, if ‘nil’, return
561 plies for black.
562
563 ‘:piece CHARACTER’
564 Return plies for a specific piece designated by CHARACTER.
565
566 ‘:file FILE’
567 Given a FILE, a number (0-7), return plies for any piece or
568 color present on that FILE. ‘:piece’ or ‘:color’ must be
569 present.
570
571 ‘:index INDEX’
572 Return plies for the piece at INDEX.
573
574 ‘:target INDEX’
575 Return plies that go to a specific coordinate specified by
576 INDEX.
577
578 ‘:candidates INDEX...’
579 If provided, only consider the source coordinates specified by
580 the indices.
581
582 These will constrain the plies generated to those matching the
583 above criteria.
584
585 NOTE: All of the returned plies will reference the same copy of the
586 position object passed in.
587
588 \1f
589 File: chess.info, Node: Ply details, Next: The "next" position, Prev: Creating plies, Up: Plies
590
591 1.2.2 Ply details
592 -----------------
593
594 -- Function: chess-ply-pos ply
595 Return the base position associated with PLY.
596
597 -- Function: chess-ply-set-pos ply position
598 Set the base position of PLY.
599
600 -- Function: chess-ply-changes
601 Return the coordinate transformations and keywords associated with
602 this PLY.
603
604 Value is a list made of a pair of indices (or two pairs, in case of
605 castling) followed by optional keywords.
606
607 -- Function: chess-ply-set-changes
608 Set the coordinate transformations and keywords associated with
609 this PLY.
610
611 -- Function: chess-ply-source ply
612 Return the source square index value of PLY.
613
614 -- Function: chess-ply-target ply
615 Return the target square index value of PLY.
616
617 For example, here is how to find the source square of a freshly
618 created ply:
619
620 (chess-ply-source (chess-ply-create chess-starting-position nil
621 (chess-coord-to-index "e2")
622 (chess-coord-to-index "e4")))
623 ⇒ 52
624
625 \1f
626 File: chess.info, Node: The "next" position, Next: Algebraic notation, Prev: Ply details, Up: Plies
627
628 1.2.3 The “next” position
629 -------------------------
630
631 -- Function: chess-ply-next-pos ply
632 Return the position that results from executing PLY.
633
634 -- Function: chess-ply-final-p ply
635 Return non-‘nil’ if this is the last ply of a game/variation.
636
637 \1f
638 File: chess.info, Node: Algebraic notation, Prev: The "next" position, Up: Plies
639
640 1.2.4 Algebraic notation
641 ------------------------
642
643 A thing to deal with in chess is algebraic move notation, such as
644 ‘Nxf3+’. This notation is a shorthand way of representing where a piece
645 is moving from and to, by specifying the piece involved, where it’s
646 going, and whether or not a capture or check is involved.
647
648 You can convert from algebraic notation to a ply using the following
649 function:
650
651 -- Function: chess-algebraic-to-ply position move &optional trust
652 Convert the algebraic notation MOVE for POSITION to a ply.
653
654 If optional argument TRUST is non-‘nil’, accept check or checkmate
655 symbols (‘+’ and ‘#’) as given.
656
657 The function also checks if a move is valid, and will raise an error
658 if not.
659
660 To convert from a ply to algebraic notation, use:
661
662 -- Function: chess-ply-to-algebraic ply &optional type
663 Convert the given PLY to algebraic notation (a string).
664
665 Optional argument TYPE specifies the kind of algebraic notation to
666 generate:
667
668 ‘:san’
669 Generate short (or standard) algebraic notation. This is the
670 default.
671
672 ‘:lan’
673 Generate long algebraic notation (like ‘Nb1-c3’).
674
675 ‘:fan’
676 Generate figurine algebraic notation (uppercase letters will
677 be replaced by Unicode chess figures).
678
679 ‘:numeric’
680 Generate ICCF numeric notation as used in correspondence chess
681 (like ‘2133’).
682
683 Lastly, there is a regexp for quickly checking if a string is in
684 algebraic notation or not, or searching out algebraic strings in a
685 buffer:
686
687 -- Variable: chess-algebraic-regexp
688 A regular expression that matches all possible algebraic moves.
689 This regexp handles short, long and figurine algebraic notation.
690
691 \1f
692 File: chess.info, Node: Variations, Next: Games, Prev: Plies, Up: The chess.el library
693
694 1.3 Variations
695 ==============
696
697 A "variation" is a sequence of plies that occur after some starting
698 position. If the starting position represents the initial setup of a
699 chess board, and if the final ply results in completion of the game, it
700 is called “the main variation”. Otherwise, variations typically
701 represented interesting tangents during a game—but not actually
702 played—as envisioned by the player, an annotator, or someone studying
703 the game.
704
705 Variations may be represented in ASCII by stating the FEN string for
706 starting position, followed by the list of plies that follow that
707 position. They are difficult to represent graphically, except for
708 showing each position in turn with a slight pause between—or by allowing
709 the user to navigate each of the subsequent positions in turn. They may
710 be represented verbally by announcing each of the plies in turn, as
711 mentioned above.
712
713 * Menu:
714
715 * Creating variations::
716 * Variation positions::
717 * Variation plies::
718 * Making a move in a variation::
719
720 \1f
721 File: chess.info, Node: Creating variations, Next: Variation positions, Up: Variations
722
723 1.3.1 Creating variations
724 -------------------------
725
726 -- Function: chess-var-create &optional position
727 Create a new chess variation object. Optionally, use the given
728 starting POSITION.
729
730 \1f
731 File: chess.info, Node: Variation positions, Next: Variation plies, Prev: Creating variations, Up: Variations
732
733 1.3.2 Variation positions
734 -------------------------
735
736 -- Function: chess-var-pos variation &optional index
737 Return the position related to VARIATION’s INDEX ply.
738
739 -- Function: chess-var-index variation
740 Return the VARIATION’s current position index.
741
742 -- Function: chess-var-seq variation
743 Return the current VARIATION sequence.
744
745 -- Function: chess-var-side-to-move variation &optional index
746 Return the color whose move it is in VARIATION at INDEX (or at the
747 last position of VARIATION if INDEX is ‘nil’).
748
749 \1f
750 File: chess.info, Node: Variation plies, Next: Making a move in a variation, Prev: Variation positions, Up: Variations
751
752 1.3.3 Variation plies
753 ---------------------
754
755 -- Function: chess-var-ply variation &optional index
756 Return VARIATION’s INDEXth ply.
757
758 -- Function: chess-var-plies variation
759 Return the plies of VARIATION.
760
761 -- Function: chess-var-to-algebraic variation &optional long
762 Reveal the plies of VARIATION by converting them to algebraic
763 notation.
764
765 \1f
766 File: chess.info, Node: Making a move in a variation, Prev: Variation plies, Up: Variations
767
768 1.3.4 Making a move in a variation
769 ----------------------------------
770
771 -- Function: chess-var-move variation ply
772 Make a move in the current VARIATION by applying the changes of
773 PLY. This creates a new position and adds it to the main
774 variation. The ‘changes’ of the last ply reflect whether the var
775 is currently in progress (‘nil’), if it is drawn, resigned, mate,
776 etc.
777
778 -- Function: chess-var-add-ply variation ply
779 Add the given PLY to VARIATION.
780
781 \1f
782 File: chess.info, Node: Games, Next: Collections, Prev: Variations, Up: The chess.el library
783
784 1.4 Games
785 =========
786
787 A "game" includes its main variation, incidental information about the
788 game (who played it, where, when, who won, etc.), and any sub-variations
789 of interest to those studying the game afterwards.
790
791 "Game tags" is an alist that associates arbitrary English tag names
792 to their values.
793
794 A game may be represented in ASCII using "PGN" (Portable Game
795 Notation). Representing them graphically or verbally is similar to what
796 is done for variations (*note Variations::).
797
798 -- Function: chess-game-add-hook game function &optional data prepend
799 Add to GAME an event hook FUNCTION.
800
801 -- Function: chess-game-add-ply game ply
802 Add PLY to the main variation of GAME.
803
804 -- Function: chess-game-hooks game
805 Return the event hooks associated with GAME.
806
807 -- Function: chess-game-plies game
808 Return the main variation of GAME as a list of plies.
809
810 -- Function: chess-game-remove-hook game function &optional data
811 Remove from GAME all event hooks that match FUNCTION. If DATA is
812 specified, only remove hooks with matching associated data.
813
814 -- Function: chess-game-run-hooks game &rest args
815 Run the event hooks of GAME and pass it ARGS.
816
817 -- Function: chess-game-set-hooks game hooks
818 Set the event hooks associated with GAME.
819
820 -- Function: chess-game-set-plies game plies
821 Set the list of plies which represents the main variation of GAME.
822
823 * Menu:
824
825 * Creating games::
826 * Game tags::
827 * Game positions::
828 * Game plies::
829 * Making a move::
830 * PGN notation::
831
832 \1f
833 File: chess.info, Node: Creating games, Next: Game tags, Up: Games
834
835 1.4.1 Creating games
836 --------------------
837
838 -- Function: chess-game-create &optional position tags
839 Create a new chess game object. Optionally use the given starting
840 POSITION. TAGS is the starting set of game tags (which can always
841 be changed later using the various tag-related methods).
842
843 \1f
844 File: chess.info, Node: Game tags, Next: Game positions, Prev: Creating games, Up: Games
845
846 1.4.2 Game tags
847 ---------------
848
849 -- Function: chess-game-tags game
850 Return the tags alist associated with GAME.
851
852 -- Function: chess-game-set-tags game tags
853 Set the tags alist associated with GAME. After the TAGS alist was
854 set the ‘set-tags’ event is triggered.
855
856 -- Function: chess-game-tag game tag
857 Return the value for TAG in GAME.
858
859 -- Function: chess-game-set-tag game tag value
860 Set the TAG for GAME to VALUE.
861
862 -- Function: chess-game-del-tag game tag
863 Delete the specified TAG from GAME.
864
865 \1f
866 File: chess.info, Node: Game positions, Next: Game plies, Prev: Game tags, Up: Games
867
868 1.4.3 Game positions
869 --------------------
870
871 -- Function: chess-game-pos game &optional index
872 Return the current position of GAME or a position of a given INDEX.
873
874 -- Function: chess-game-index game
875 Return the GAME’s current position index.
876
877 -- Function: chess-game-seq game
878 Return the current GAME sequence number.
879
880 -- Function: chess-game-side-to-move game &optional index
881 Return the side, specified as color, whose move it is in GAME at
882 INDEX (or at the last position if INDEX is ‘nil’). Value is ‘t’
883 for white and ‘nil’ for black.
884
885 \1f
886 File: chess.info, Node: Game plies, Next: Making a move, Prev: Game positions, Up: Games
887
888 1.4.4 Game plies
889 ----------------
890
891 -- Function: chess-game-ply game &optional index
892 Return a ply of GAME. If INDEX is non-‘nil’, the last played ply
893 is returned.
894
895 \1f
896 File: chess.info, Node: Making a move, Next: PGN notation, Prev: Game plies, Up: Games
897
898 1.4.5 Making a move
899 -------------------
900
901 -- Function: chess-game-move game ply
902 Make a move in the current GAME using PLY. This creates a new
903 position and adds it to the main variation. The ‘changes’ of the
904 last ply reflect whether the game is currently in progress (‘nil’),
905 if it is drawn, resigned, mate, etc.
906
907 \1f
908 File: chess.info, Node: PGN notation, Prev: Making a move, Up: Games
909
910 1.4.6 PGN notation
911 ------------------
912
913 -- Function: chess-pgn-to-game &optional string
914 Convert the PGN notation at point into a chess game. Optionally
915 use the supplied STRING instead of the current buffer.
916
917 -- Function: chess-game-to-pgn game &optional indented to-string
918 Convert a chess GAME to PGN notation. If INDENTED is non-‘nil’,
919 indent the move texts. If TO-STRING is non-‘nil’, return a string
920 instead of inserting the resulting PGN text.
921
922 -- Function: chess-pgn-insert-plies game index plies &optional
923 for-black indented no-annotations
924 _NYI_: Still have to implement the INDENTED argument.
925
926 * Menu:
927
928 * PGN mode::
929
930 \1f
931 File: chess.info, Node: PGN mode, Up: PGN notation
932
933 1.4.6.1 PGN mode
934 ................
935
936 -- Function: chess-pgn-visualize
937 Visualize the move for the PGN game under point. This does not
938 require that the buffer be in PGN mode.
939
940 \1f
941 File: chess.info, Node: Collections, Next: Chess Opening Books, Prev: Games, Up: The chess.el library
942
943 1.5 Collections
944 ===============
945
946 A "collection" is a set of games archived for later perusal. A set of
947 games conceptually represents a large tree of branching variations, and
948 can be used for studying current theory, examining Master preferences,
949 etc.
950
951 ‘Chess.el’ itself does not attempt to provide library services, nor
952 does it ever represent library collections in memory. Instead, it
953 interacts with a chess database engine for the purpose of storing and
954 retrieving games from the library, or performing library-wide analyses
955 and searches.
956
957 * Menu:
958
959 * Opening Databases::
960 * Querying Databases::
961 * Modifying Databases::
962 * Finalizing Databases::
963 * Database Modules::
964
965 \1f
966 File: chess.info, Node: Opening Databases, Next: Querying Databases, Up: Collections
967
968 1.5.1 Opening Databases
969 -----------------------
970
971 -- Variable: chess-database-modules
972 List of database modules to try when ‘chess-database-open’ is
973 called.
974
975 -- Function: chess-database-open file &optional module
976 Open a game database specified by FILE. You can optionally specify
977 the database MODULE to use.
978
979 Returns the opened database object, or nil.
980
981 \1f
982 File: chess.info, Node: Querying Databases, Next: Modifying Databases, Prev: Opening Databases, Up: Collections
983
984 1.5.2 Querying Databases
985 ------------------------
986
987 -- Function: chess-database-filename database
988 Return the filename of an already opened DATABASE.
989
990 -- Function: chess-database-read database index
991 Return from DATABASE the chess game object at INDEX.
992
993 -- Function: chess-database-query database &rest terms
994 Run a query on DATABASE. The TERMS are partly dependent on the
995 chess-database module in use. For the ‘chess-scid’ module, using
996 ‘tree-search GAME’ means perform a tree search on the last position
997 of GAME.
998
999 \1f
1000 File: chess.info, Node: Modifying Databases, Next: Finalizing Databases, Prev: Querying Databases, Up: Collections
1001
1002 1.5.3 Modifying Databases
1003 -------------------------
1004
1005 -- Function: chess-database-read-only-p database
1006 Return non-‘nil’ if DATABASE is read only.
1007
1008 \1f
1009 File: chess.info, Node: Finalizing Databases, Next: Database Modules, Prev: Modifying Databases, Up: Collections
1010
1011 1.5.4 Finalizing Databases
1012 --------------------------
1013
1014 \1f
1015 File: chess.info, Node: Database Modules, Prev: Finalizing Databases, Up: Collections
1016
1017 1.5.5 Database Modules
1018 ----------------------
1019
1020 Currently, there are two subclasses of the above defined database
1021 base-class:
1022
1023 * Menu:
1024
1025 * chess-file::
1026 * chess-scid::
1027
1028 \1f
1029 File: chess.info, Node: chess-file, Next: chess-scid, Up: Database Modules
1030
1031 1.5.5.1 chess-file
1032 ..................
1033
1034 This module does not use an external chess database program to store and
1035 retrieve games. It uses the PGN of EPD format parsing routines provided
1036 in ‘chess-pgn.el’ and ‘chess-epd.el’ to implement collections for
1037 ordinary PGN and EPD files.
1038
1039 EPD file collections are represented as a collection of games
1040 originating at the given position. One might argue that conceptually,
1041 they represent a collection of positions, but it is more convenient to
1042 merge all collections into one uniform concept.
1043
1044 \1f
1045 File: chess.info, Node: chess-scid, Prev: chess-file, Up: Database Modules
1046
1047 1.5.5.2 chess-scid
1048 ..................
1049
1050 This module implements basic reading and writing functionality for
1051 "SCID" (Shane’s Chess Information Database) files.
1052
1053 \1f
1054 File: chess.info, Node: Chess Opening Books, Prev: Collections, Up: The chess.el library
1055
1056 1.6 Chess Opening Books
1057 =======================
1058
1059 There are two different modules/libraries provided for looking up chess
1060 positions in opening books.
1061
1062 * Menu:
1063
1064 * ECO Classification::
1065 * Polyglot opening book format support::
1066
1067 \1f
1068 File: chess.info, Node: ECO Classification, Next: Polyglot opening book format support, Up: Chess Opening Books
1069
1070 1.6.1 ECO Classification
1071 ------------------------
1072
1073 Module ‘chess-eco’ provides a database of well known names for chess
1074 opening positions. If this module is activated (see variable
1075 ‘chess-default-modules’), known chess opening positions will be
1076 announced in the minibuffer during a game.
1077
1078 \1f
1079 File: chess.info, Node: Polyglot opening book format support, Prev: ECO Classification, Up: Chess Opening Books
1080
1081 1.6.2 Polyglot opening book format support
1082 ------------------------------------------
1083
1084 The popular and freely documented Polyglot opening book format is
1085 supported. There is a default polyglot book file shipped with
1086 ‘chess.el’ to support engines which do not have built-in support for
1087 looking up positions in opening books (such as some UCI protocol based
1088 engines).
1089
1090 -- User Option: chess-polyglot-book-file
1091 Path to default polyglot book file.
1092
1093 -- Variable: chess-polyglot-book
1094 If non-‘nil’, the buffer holding the currently loaded polyglot book
1095 data.
1096
1097 This is used by UCI based engine modules as well as the internal
1098 AI.
1099
1100 -- Function: chess-polyglot-book-open file
1101 Open a polyglot book FILE.
1102
1103 Returns a buffer object which contains the binary data.
1104
1105 -- Function: chess-polyglot-book-plies book position
1106 Return a list of plies found in BOOK for POSITION. The resulting
1107 list is ordered, most interesting plies come first. The
1108 ‘:polyglot-book-weight’ ply keyword is used to store the actual
1109 move weights. Use ‘chess-ply-keyword’ on elements of the returned
1110 list to retrieve them.
1111
1112 -- Function: chess-polyglot-book-ply book position &optional strength
1113 If non-‘nil’, a (randomly picked) ply from BOOK for POSITION.
1114 Random distribution is defined by the relative weights of the found
1115 plies. If non-‘nil’, STRENGTH defines the bias towards better
1116 moves. A value below 1.0 will penalize known good moves while a
1117 value above 1.0 will prefer known good moves. The default is the
1118 value of ‘chess-polyglot-book-strength’. A strength value of 0.0
1119 will completely ignore move weights, and evenly distribute the
1120 probability that a move gets picked.
1121
1122 \1f
1123 File: chess.info, Node: Modules, Next: Chessboard displays, Prev: The chess.el library, Up: Top
1124
1125 2 Modules
1126 *********
1127
1128 Positions, plies and variations are typically accessed in reference to a
1129 game object, which has a main variation containing the plies and
1130 positions that represent the number of moves made within that game up to
1131 the final position.
1132
1133 Another thing that the game object does is to manage events that
1134 occur within that game. If a move is made from the final position, for
1135 example, it will cause a new ply to be created, adding it to the end of
1136 the main variation. Then, a ‘move’ event is triggered within the game
1137 and passed to any chess modules which are currently associated with that
1138 game. The concept of modules allows far more complex aspects of chess
1139 playing to be dealt with, while allowing the library itself to still
1140 operate solely in terms of the game object.
1141
1142 For example, although the plies of a game object contain all the
1143 information the computer needs to follow the game, a user needs much
1144 more. He wants to see the pieces move. To support this, a display
1145 module (*note Chessboard displays::) can be created, and linked to the
1146 game. The first effect of this association will be to create a chess
1147 board display and show the game’s final position on it. Now whenever
1148 plies are added to the game, the chess board will be updated to show the
1149 effect of that move on the board. The display module realizes that a
1150 move has been made by receiving the ‘move’ event which is passed to all
1151 modules associated with the game object.
1152
1153 There may be any number of modules associated with a chess game, and
1154 they may do anything you like. Basically, for a module called
1155 ‘chess-sample’, a function must exist called ‘chess-sample-handler’.
1156 This takes two or more arguments: a game object, the event symbol, and
1157 whatever other arguments were passed along with the event symbol.
1158
1159 When an event is triggered on a game object (this may happen as a
1160 byproduct of manipulating the game, or events may be manually
1161 generated), every associated module, in order, is called with that event
1162 and whatever arguments were passed along with the event. The game
1163 object is passed also, so that the module knows which game this event
1164 has occurred in reference to.
1165
1166 Once called, the module can do whatever it likes. Some events expect
1167 certain values to be returned, to indicate success or failure in
1168 processing the event. There are many different events, each depicting
1169 something specific that might happen in the context of playing or
1170 manipulating a chess game. Some events relate only to the chess game
1171 itself, some are triggered by the various chess engines that might be
1172 associated with that game. Modules may even trigger events in response
1173 to event. The game itself remains unaware of events, except for the
1174 fact that it will pass them along to every module associated with that
1175 game.
1176
1177 This is how displays get updated, for example, because once a ‘move’
1178 event is triggered, each display knows that it must now look at the new
1179 final position and update its display. It may even trigger new events
1180 special to displays, to cause a refresh to happen after update
1181 calculations have been performed, for example. All such details are
1182 left to the module, and the game does not interfere with such
1183 intra-module messaging.
1184
1185 Looked at as an object-oriented design, these are typical polymorphic
1186 events. Certain generic situations frequently occur, such as moves,
1187 which trigger events so that everyone concerned with the game can be
1188 updated as to the move that occurred. This way, no one need to actively
1189 query the game to find out if something new has happened. The game will
1190 notify every listening module by sending an event.
1191
1192 The core library, which consists of code to manipulate games, does
1193 not define any modules. The rest of the ‘chess.el’ library is strictly
1194 a set of module implementations, of various types. Display modules
1195 react to moves, and may modify the game based on user input; engine
1196 modules react to moves by notifying the engine of the move; network
1197 client modules react to moves by sending the move text over the network.
1198 Engine and network modules may also trigger new events when the engine
1199 or network player has decided on their move, and this move is then
1200 applied to the game object.
1201
1202 At the moment, no negotiation is done to determine which module may
1203 modify the game object. All modules have equal privilege. This means
1204 it is the programmer’s duty not to associate conflicting modules with a
1205 single game object. If two artificial intelligence engines were linked,
1206 for example, they would quickly start stepping on each other’s toes.
1207 But it is perfectly fine to have one artificial intelligence engine, and
1208 another passive engine whose only purpose is to relay the moves to a
1209 networked observer on another computer. The possibilities are endless.
1210
1211 Modules are very easy to write, although engines and displays are
1212 rather different from each other in their principles. There is a base
1213 engine, and a base display, which receive the same events as any other
1214 module. But then there are derived engines and derived displays which
1215 trigger a whole family of events specific to those module types. If you
1216 suspect a bug in your module, put a breakpoint in your handler function,
1217 and wait for the offending event to come through. Then you can watch
1218 what your module does in response to that event. If it leaves the game
1219 object alone, it should be easy to locate the problem, since it will
1220 always be within the module itself. But if your module also modifies
1221 the game object in response to certain events, you may induce a feedback
1222 loop that is much more difficult to sort out. Test often and keep in
1223 mind that _many_ events might end up coming through as a result of the
1224 game changes your module makes!
1225
1226 That, in essence, is how the module system works. From the game
1227 object’s perspective, it is a very simple mechanism, much like a
1228 function ring or a hook. The hook is called at certain points, so that
1229 any listener can react to changes in the game. But from each module’s
1230 perspective, it is a rich way to allow inter-operation between both
1231 passive and reactive modules, all of them acting together to enrich the
1232 context of play involving the central game object.
1233
1234 The only other rule to be mentioned is that each module instance
1235 should be associated with only one game object at a time, although a
1236 game object may have unlimited modules of any type linked to it.
1237 Otherwise, trying to update a chess board based on input from two
1238 different games would get impossible to sort out. Better to create a
1239 new board for every game—the way ordinary humans would do it in the real
1240 world.
1241
1242 \1f
1243 File: chess.info, Node: Chessboard displays, Next: Engines, Prev: Modules, Up: Top
1244
1245 3 Chessboard displays
1246 *********************
1247
1248 The previous chapter described all the objects found in chess—positions,
1249 plies, variations, games and collections. However, these objects can
1250 only be manipulated programmatically using the functions given so far.
1251 In order to present them in a meaningful fashion to a human reader, it
1252 is necessary to create and use a display object.
1253
1254 * Menu:
1255
1256 * Generic display manipulation functions::
1257 * Chess display mode::
1258 * Plain ASCII diagram displays::
1259 * ICS1 style ASCII displays::
1260 * Graphical displays::
1261
1262 \1f
1263 File: chess.info, Node: Generic display manipulation functions, Next: Chess display mode, Up: Chessboard displays
1264
1265 3.1 Generic display manipulation functions
1266 ==========================================
1267
1268 -- Function: chess-display-create game style perspective
1269 Create a chess display, for displaying chess objects. The GAME is
1270 the chess game object to use, STYLE should be the display type to
1271 use (a symbol), and PERSPECTIVE determines the viewpoint of the
1272 board: if non-‘nil’, the board is viewed from White’s perspective.
1273
1274 -- Function: chess-display-active-p
1275 Return non-‘nil’ if the displayed chessboard reflects an active
1276 game. Basically, it means we are playing, not editing or
1277 reviewing.
1278
1279 -- Function: chess-display-clear-board
1280 Setup the current board for editing.
1281
1282 -- Function: chess-display-highlight display &rest args
1283 Highlight in DISPLAY the squares given in ARGS on the current
1284 position.
1285
1286 The ARGS is a list of highlighting modes and position coordinates.
1287 The default highlighting mode is ‘:selected’ which is supported by
1288 most displays.
1289
1290 -- Function: chess-display-invert
1291 Invert the perspective of the current chess board.
1292
1293 -- Function: chess-display-move display ply
1294 Move a piece on DISPLAY, by applying the given PLY. The position
1295 of PLY must match the currently displayed position.
1296
1297 -- Function: chess-display-perspective display
1298 Return the current perspective of DISPLAY.
1299
1300 -- Function: chess-display-position display
1301 Return the position currently viewed on DISPLAY.
1302
1303 -- Function: chess-display-quit
1304 Quit the game associated with the current display.
1305
1306 -- Function: chess-display-set-game display game &optional index
1307 Set the given DISPLAY to display the GAME object, optionally at
1308 INDEX. This is the function to call to cause a display to view a
1309 game. It will also update all of the listening engines and other
1310 displays to also view the same game.
1311
1312 -- Function: chess-display-set-perspective display perspective
1313 Set PERSPECTIVE of DISPLAY.
1314
1315 -- Function: chess-display-set-position display &optional position
1316 my-color
1317 Set the game associated with DISPLAY to use POSITION and MY-COLOR.
1318
1319 -- Function: chess-display-set-variation display variation &optional
1320 index
1321 Set DISPLAY VARIATION. If INDEX is not specified, this will cause
1322 the first ply in the variation to be displayed, with the user able
1323 to scroll back and forth through the moves in the variation. Any
1324 moves made on the board will extend/change the variation that was
1325 passed in.
1326
1327 -- Function: chess-display-update display &optional popup
1328 Update the chessboard DISPLAY. If POPUP is non-‘nil’, make sure it
1329 is visible.
1330
1331 \1f
1332 File: chess.info, Node: Chess display mode, Next: Plain ASCII diagram displays, Prev: Generic display manipulation functions, Up: Chessboard displays
1333
1334 3.2 Chess display mode
1335 ======================
1336
1337 "Chess display mode" is a special major mode (*note (emacs)Major
1338 Modes::) that allows to select pieces to move with the mouse or by
1339 moving point to the desired square/piece. Additionally, you can enter
1340 moves in a variant of algebraic notation via the keyboard.
1341
1342 All the chessboard displays described in following sub-sections share
1343 the basic behavior provided by chess display mode. They basically only
1344 differ in appearance of the various chessboards.
1345
1346 -- User Option: chess-display-highlight-legal
1347 If non-nil, highlight valid target squares when a piece is
1348 selected.
1349
1350 * Menu:
1351
1352 * Basic operations::
1353 * Selecting pieces with the keyboard::
1354 * Selecting pieces with the mouse::
1355 * Entering moves with algebraic notation::
1356
1357 \1f
1358 File: chess.info, Node: Basic operations, Next: Selecting pieces with the keyboard, Up: Chess display mode
1359
1360 3.2.1 Basic operations
1361 ----------------------
1362
1363 ‘C-i’
1364 ‘<TAB>’
1365 Invert the perspective of the current chess board
1366 (‘chess-display-invert’).
1367
1368 ‘,’
1369 Show the previous move in the current game
1370 (‘chess-display-move-backward’).
1371
1372 ‘C-r’
1373 Find previous move which algebraic notation matches a regular
1374 expression (‘chess-display-search-backward’).
1375
1376 ‘C-s’
1377 Find next move which algebraic notation matches a regular
1378 expression (‘chess-display-search-forward’).
1379
1380 ‘.’
1381 Show the next move in the current game
1382 (‘chess-display-move-forward’).
1383
1384 ‘<’
1385 Move to the initial position of the current game
1386 (‘chess-display-move-first’).
1387
1388 ‘>’
1389 Move to the last position of the current game
1390 (‘chess-display-move-last’).
1391
1392 ‘C-c C-d’
1393 Offer to draw the current game (‘chess-display-draw’).
1394
1395 ‘C-c C-r’
1396 Resign the current game (‘chess-display-resign’).
1397
1398 ‘M-w’
1399 ‘C-u M-w’
1400 Copy the currently displayed position to the kill ring as a FEN
1401 string (‘chess-display-kill-board’).
1402
1403 With prefix argument, copy the current game in PGN to the kill
1404 ring.
1405
1406 ‘C-y’
1407 Set the current display position via a FEN string from the kill
1408 ring (‘chess-display-yank-board’).
1409
1410 This is useful to copy positions from one chessboard display to
1411 another, as well as quickly setting up a position from a FEN string
1412 previously added to the kill ring from somewhere else.
1413
1414 ‘X’
1415 Quit this chessboard display (‘chess-display-quit’).
1416
1417 This destroys the session (and all related modules) associated with
1418 this chessboard display.
1419
1420 \1f
1421 File: chess.info, Node: Selecting pieces with the keyboard, Next: Selecting pieces with the mouse, Prev: Basic operations, Up: Chess display mode
1422
1423 3.2.2 Selecting pieces with the keyboard
1424 ----------------------------------------
1425
1426 In character based chessboard displays, point can be moved around in the
1427 buffer as usual. You can indicate the initial square/piece and the
1428 target square/piece by moving point to the desired position and pressing
1429 ‘<RET>’.
1430
1431 ‘<RET>’
1432 Select the piece/square currently indicated by point
1433 (‘chess-display-select-piece’) to move from/to.
1434
1435 \1f
1436 File: chess.info, Node: Selecting pieces with the mouse, Next: Entering moves with algebraic notation, Prev: Selecting pieces with the keyboard, Up: Chess display mode
1437
1438 3.2.3 Selecting pieces with the mouse
1439 -------------------------------------
1440
1441 Similarly, you can also use the mouse (if available) to indicate the
1442 source and target square of your move.
1443
1444 ‘down-mouse-1’
1445 ‘down-mouse-2’
1446 ‘drag-mouse-1’
1447 ‘drag-mouse-2’
1448 Select the piece/square currently indicated by the mouse pointer
1449 (‘chess-display-select-piece’) to move from/to.
1450
1451 \1f
1452 File: chess.info, Node: Entering moves with algebraic notation, Prev: Selecting pieces with the mouse, Up: Chess display mode
1453
1454 3.2.4 Entering moves with algebraic notation
1455 --------------------------------------------
1456
1457 ‘a’ … ‘h’
1458 ‘1’ … ‘8’
1459 ‘N’
1460 ‘B’
1461 ‘R’
1462 ‘Q’
1463 ‘K’
1464 ‘x’
1465 ‘=’
1466 Enter move in algebraic notation.
1467
1468 The move will be accepted as soon as it is unambiguous. So in most
1469 situations, you do not need to type the complete algebraic move
1470 string. For instance, if there is only one piece which can be
1471 taken by one of your knights, typing ‘N x’ is sufficient to select
1472 that move.
1473
1474 Additionally, the characters ‘x’ and ‘=’ are optional, as there is
1475 no difference between ‘N x e 4’ and ‘N e 4’.
1476
1477 <backspace>
1478 Delete the last entered chess move character
1479 (‘chess-input-shortcut-delete’).
1480
1481 This is useful if you have accidentally typed a wrong character,
1482 and the move was not unambiguous yet.
1483
1484 \1f
1485 File: chess.info, Node: Plain ASCII diagram displays, Next: ICS1 style ASCII displays, Prev: Chess display mode, Up: Chessboard displays
1486
1487 3.3 Plain ASCII diagram displays
1488 ================================
1489
1490 The simplest display style available is ‘chess-plain’, a very
1491 customizable ASCII board diagram display.
1492
1493 This is how the starting position looks in its default configuration:
1494
1495 +---------------+
1496 8|r n b q k b n r|
1497 7|p p p p p p p p|
1498 6|. . . . . . . .|
1499 5|. . . . . . . .|
1500 4|. . . . . . . .|
1501 3|. . . . . . . .|
1502 2|P P P P P P P P|
1503 1|R N B Q K B N R|
1504 +---------------+
1505 a b c d e f g h
1506
1507 -- User Option: chess-plain-separate-frame
1508 If non-‘nil’, display the chessboard in its own frame.
1509
1510 -- User Option: chess-plain-border-style
1511 If non-‘nil’, a vector of Characters used to draw borders.
1512
1513 Otherwise, omit to draw any border around the chessboard diagram.
1514
1515 -- User Option: chess-plain-black-square-char
1516 Character used to indicate empty black squares.
1517
1518 -- User Option: chess-plain-white-square-char
1519 Character used to indicate black white squares.
1520
1521 -- User Option: chess-plain-piece-chars
1522 Alist of pieces and their corresponding characters.
1523
1524 -- User Option: chess-plain-upcase-indicates
1525 Defines what an upcase char should indicate. The default is
1526 ‘'color’, meaning a upcase char is a white piece, a lowercase char
1527 a black piece. Possible values: ‘'color’ (default),
1528 ‘'square-color’. If set to ‘'square-color’, an uppercase character
1529 indicates a piece on a black square. (Note that you also need to
1530 modify ‘chess-plain-piece-chars’ to avoid real confusion.)
1531
1532 -- User Option: chess-plain-spacing
1533 Number of spaces between files.
1534
1535 To customize options of ‘chess-plain’, use ‘M-x customize-group <RET>
1536 chess-plain <RET>’.
1537
1538 \1f
1539 File: chess.info, Node: ICS1 style ASCII displays, Next: Graphical displays, Prev: Plain ASCII diagram displays, Up: Chessboard displays
1540
1541 3.4 ICS1 style ASCII displays
1542 =============================
1543
1544 The ‘chess-ics1’ module is a more verbose ASCII chessboard display.
1545
1546 This is how the starting position looks with this chessboard display:
1547
1548 +---+---+---+---+---+---+---+---+
1549 8 | r | n | b | q | k | b | n | r |
1550 +---+---+---+---+---+---+---+---+
1551 7 | p | p | p | p | p | p | p | p |
1552 +---+---+---+---+---+---+---+---+
1553 6 | | | | | | | | |
1554 +---+---+---+---+---+---+---+---+
1555 5 | | | | | | | | |
1556 +---+---+---+---+---+---+---+---+
1557 4 | | | | | | | | |
1558 +---+---+---+---+---+---+---+---+
1559 3 | | | | | | | | |
1560 +---+---+---+---+---+---+---+---+
1561 2 | P | P | P | P | P | P | P | P |
1562 +---+---+---+---+---+---+---+---+
1563 1 | R | N | B | Q | K | B | N | R |
1564 +---+---+---+---+---+---+---+---+
1565 a b c d e f g h
1566
1567 -- User Option: chess-ics1-separate-frame
1568 If non-‘nil’, display the chessboard in its own frame.
1569
1570 To customize options of ‘chess-ics1’, use ‘M-x customize-group <RET>
1571 chess-ics1 <RET>’.
1572
1573 \1f
1574 File: chess.info, Node: Graphical displays, Prev: ICS1 style ASCII displays, Up: Chessboard displays
1575
1576 3.5 Graphical displays
1577 ======================
1578
1579 The graphical chessboard display (‘chess-images’) uses image files to
1580 create a visually appealing chessboard in a buffer.
1581
1582 -- User Option: chess-images-directory
1583 A directory which contains images in XPM format.
1584
1585 If you want to draw your own images, each image file must be named
1586 ‘COLOR-PIECE.xpm’, where COLOR is either black or white, and PIECE
1587 is one of rook, knight, bishop, queen, king or pawn.
1588
1589 The only image format currently supported is XPM.
1590
1591 -- User Option: chess-images-separate-frame
1592 If non-‘nil’, display the chessboard in its own frame.
1593
1594 For all customization options of ‘chess-images’, use ‘M-x
1595 customize-group <RET> chess-images <RET>’.
1596
1597 \1f
1598 File: chess.info, Node: Engines, Next: Chess Session, Prev: Chessboard displays, Up: Top
1599
1600 4 Engines
1601 *********
1602
1603 "Engines" represent opponents in Chess. The main type of engine
1604 interfaces with an external chess program. However, there can be other
1605 uses for engine objects, such as providing networked engined for playing
1606 with opponent over different types of transports.
1607
1608 * Menu:
1609
1610 * Common functions::
1611 * The Null Engine::
1612 * AI::
1613 * Crafty::
1614 * Fruit::
1615 * Glaurung::
1616 * GNU Chess::
1617 * Phalanx::
1618 * Sjeng::
1619 * Stockfish::
1620
1621 \1f
1622 File: chess.info, Node: Common functions, Next: The Null Engine, Up: Engines
1623
1624 4.1 Common functions
1625 ====================
1626
1627 -- Function: chess-engine-create module game &optional response-handler
1628 &rest handler-ctor-args
1629 Create a new chess engine MODULE (a symbol) associated with GAME.
1630 Optionally supply a new RESPONSE-HANDLER.
1631
1632 -- Function: chess-engine-set-option engine option value
1633 Set ENGINE OPTION to VALUE by invoking its handler with the
1634 ‘set-option’ event.
1635
1636 -- Function: chess-engine-position engine
1637 Return the current position of the game associated with ENGINE.
1638
1639 -- Function: chess-engine-command engine event &rest args
1640 Call the handler of ENGINE with EVENT (a symbol) and ARGS.
1641
1642 -- Function: chess-engine-send engine string
1643 Send the given STRING to ENGINE. If ‘chess-engine-process’ is a
1644 valid process object, use ‘process-send-string’ to submit the data.
1645 Otherwise, the ‘send’ event is triggered and the engine event
1646 handler can take care of the data.
1647
1648 \1f
1649 File: chess.info, Node: The Null Engine, Next: AI, Prev: Common functions, Up: Engines
1650
1651 4.2 The Null Engine
1652 ===================
1653
1654 The most basic engine module is ‘chess-none’, a stub module that does
1655 nothing. This is useful for a game of chess against another human,
1656 where both use the same computer to enter moves and display the current
1657 chess position.
1658
1659 It can also be useful for creating FEN strings of specific positions.
1660
1661 To bring up a chessboard with no active engine attached, use ‘C-u M-x
1662 chess <RET> none <RET>’.
1663
1664 \1f
1665 File: chess.info, Node: AI, Next: Crafty, Prev: The Null Engine, Up: Engines
1666
1667 4.3 AI
1668 ======
1669
1670 The AI engine module defines a pure Emacs Lisp implementation of an
1671 opponent. Contrary to all other engine modules mentioned later on, it
1672 does not require any external programs to be installed.
1673
1674 To explicitly select this engine as an opponent, use ‘C-u M-x chess
1675 <RET> ai <RET>’.
1676
1677 -- User Option: chess-ai-depth
1678 Defines the default search depth for this engine.
1679
1680 -- User Option: chess-ai-quiescence-depth
1681 Defines the number of plies to search for a quiet position. This
1682 is in addition to ‘chess-ai-depth’.
1683
1684 If you’d like to employ the search and evaluation functions provided
1685 by this module programmatically, the following function is the top-level
1686 entry point.
1687
1688 -- Function: chess-ai-best-move position &optional depth eval-fn
1689 Find the supposedly best move (ply) for POSITION. DEPTH defaults
1690 to the value of ‘chess-ai-depth’.
1691
1692 \1f
1693 File: chess.info, Node: Crafty, Next: Fruit, Prev: AI, Up: Engines
1694
1695 4.4 Crafty
1696 ==========
1697
1698 "Crafty" is a chess program written by Michael Byrne, UAB professor
1699 Dr. Robert Hyatt, Tracy Riegle, Peter Skinner and Ted Langreck. It is
1700 directly derived from Cray Blitz, winner of the 1983 and 1986 World
1701 Computer Chess Championships.
1702
1703 If the ‘crafty’ program is installed and can be found in the program
1704 search path (‘exec-path’), the ‘chess-crafty’ engine module will
1705 automatically detect it.
1706
1707 If ‘crafty’ is installed in a non-standard location, variable
1708 ‘chess-crafty-path’ can be set to point to its executable file.
1709
1710 If you have multiple engines installed you can explicitly select to
1711 play against Crafty by invoking ‘C-u M-x chess <RET> crafty <RET>’.
1712
1713 \1f
1714 File: chess.info, Node: Fruit, Next: Glaurung, Prev: Crafty, Up: Engines
1715
1716 4.5 Fruit
1717 =========
1718
1719 "Fruit" is a chess engine developed by Fabien Letouzey. It was
1720 commercially available from September 2005 until July 2007. Now it is
1721 freeware and you can download it for free from
1722 <http://www.fruitchess.com/>. The development on Fruit by Fabien
1723 Letouzey has ceded and it is unlikely to continue.
1724
1725 Fruit was vice world computer chess champion 2005.
1726
1727 If the ‘fruit’ command is installed and can be found in the program
1728 search path (‘exec-path’), the ‘chess-fruit’ engine module will
1729 automatically detect it.
1730
1731 If Fruit is installed in a non-standard location, variable
1732 ‘chess-fruit-path’ can be set to point to its executable file.
1733
1734 If you have multiple engines installed you can explicitly select to
1735 play against Fruit by invoking ‘C-u M-x chess <RET> fruit <RET>’.
1736
1737 \1f
1738 File: chess.info, Node: Glaurung, Next: GNU Chess, Prev: Fruit, Up: Engines
1739
1740 4.6 Glaurung
1741 ============
1742
1743 "Glaurung" is another freely distributed strong computer chess engine.
1744
1745 If the ‘glaurung’ program is installed and can be found in the
1746 program search path (‘exec-path’), the ‘chess-glaurung’ engine module
1747 will automatically detect it.
1748
1749 If Glaurung is installed in a non-standard location, variable
1750 ‘chess-glaurung-path’ can be set to point to its executable file.
1751
1752 If you have multiple engines installed you can explicitly select to
1753 play against Glaurung by invoking ‘C-u M-x chess <RET> glaurung <RET>’.
1754
1755 \1f
1756 File: chess.info, Node: GNU Chess, Next: Phalanx, Prev: Glaurung, Up: Engines
1757
1758 4.7 GNU Chess
1759 =============
1760
1761 "GNU Chess" (http://gnu.org/software/chess/) is free software, licensed
1762 under the terms of the GNU General Public License, and is maintained by
1763 collaborating developers. As one of the earliest computer chess
1764 programs with full source code available, it’s one of the oldest for
1765 Unix-based systems and has since been ported to many other platforms.
1766
1767 If the ‘gnuchess’ program is installed and can be found in the
1768 program search path (‘exec-path’), the ‘chess-gnuchess’ engine module
1769 will automatically detect it.
1770
1771 If GNU Chess is installed in a non-standard location, variable
1772 ‘chess-gnuchess-path’ can be set to point to its executable file.
1773
1774 If you have multiple engines installed you can explicitly select to
1775 play against GNU Chess by invoking ‘C-u M-x chess <RET> gnuchess <RET>’.
1776
1777 \1f
1778 File: chess.info, Node: Phalanx, Next: Sjeng, Prev: GNU Chess, Up: Engines
1779
1780 4.8 Phalanx
1781 ===========
1782
1783 "Phalanx" is an old, popular chess engine, with an interesting history.
1784
1785 If the ‘phalanx’ program is installed and can be found in the program
1786 search path (‘exec-path’), the ‘chess-phalanx’ engine module will
1787 automatically detect it.
1788
1789 If Phalanx is installed in a non-standard location, variable
1790 ‘chess-phalanx-path’ can be set to point to its executable file.
1791
1792 If you have multiple engines installed you can explicitly select to
1793 play against Phalanx by invoking ‘C-u M-x chess <RET> phalanx <RET>’.
1794
1795 \1f
1796 File: chess.info, Node: Sjeng, Next: Stockfish, Prev: Phalanx, Up: Engines
1797
1798 4.9 Sjeng
1799 =========
1800
1801 "Sjeng" (http://sjeng.org/) is a championship-winner automated chess
1802 engine developed by Gian-Carlo Pascutto from Belgium. While its
1803 original version was free, recent developments are for sale.
1804
1805 If the ‘sjeng’ program is installed and can be found in the program
1806 search path (‘exec-path’), the ‘chess-sjeng’ engine module will
1807 automatically detect it.
1808
1809 If Sjeng is installed in a non-standard location, variable
1810 ‘chess-sjeng-path’ can be set to point to its executable file.
1811
1812 If you have multiple engines installed you can explicitly select to
1813 play against Sjeng by invoking ‘C-u M-x chess <RET> sjeng <RET>’.
1814
1815 \1f
1816 File: chess.info, Node: Stockfish, Prev: Sjeng, Up: Engines
1817
1818 4.10 Stockfish
1819 ==============
1820
1821 "Stockfish" (http://www.stockfishchess.org/) is one of the strongest
1822 chess engines in the world, appearing near or at the top of most chess
1823 engine rating lists. Stockfish is also free software, licensed under
1824 the terms of the GNU General Public License.
1825
1826 If the ‘stockfish’ program is installed and can be found in the
1827 program search path (‘exec-path’), the ‘chess-stockfish’ engine module
1828 will automatically detect it.
1829
1830 If Stockfish is installed in a non-standard location, variable
1831 ‘chess-stockfish-path’ can be set to point to its executable file.
1832
1833 If you have multiple engines installed you can explicitly select to
1834 play against Stockfish by invoking ‘C-u M-x chess <RET> stockfish
1835 <RET>’.
1836
1837 \1f
1838 File: chess.info, Node: Chess Session, Next: Internet Chess Servers, Prev: Engines, Up: Top
1839
1840 5 Chess Session
1841 ***************
1842
1843 A "chess session" assembles all modules mentioned in previous chapters
1844 into a working system to interact with. A session typically consists of
1845 at least one display module, one engine module, and possibly a number of
1846 optional modules. All these modules share a common game object which is
1847 used to keep track of the currently active game.
1848
1849 -- Function: chess engine disable-popup engine-response-handler &rest
1850 engine-ctor-args
1851 Play a game against ENGINE.
1852
1853 This function constructs all the necessary modules required for a
1854 chess session. In particular, it will start ENGINE and create a
1855 chess display as configured in ‘chess-default-display’.
1856
1857 This is the main entry-point for interactively launching a
1858 chessboard display with associated engine.
1859
1860 If you want to launch a chess session as part of your own code, the
1861 probably more expressive alias ‘chess-session’ might be interesting
1862 to use.
1863
1864 You can have several active chess sessions. In fact, some features
1865 later described in this manual make use of this, *note Internet Chess
1866 Servers::.
1867
1868 To interactively start a chess session, invoke ‘M-x chess <RET>’.
1869 This uses ‘chess-default-display’ to determine the chessboard display to
1870 use, and ‘chess-default-engine’ to determine an opponent.
1871
1872 If you want to play against a specific engine, provide a prefix
1873 argument as in ‘C-u M-x chess <RET>’, which will prompt for an engine
1874 module. The module name has the common prefix ‘chess-’ stripped. So
1875 you enter ‘gnuchess’ to indicate you’d like to play against the
1876 ‘chess-gnuchess’ module.
1877
1878 \1f
1879 File: chess.info, Node: Internet Chess Servers, Next: GNU Free Documentation License, Prev: Chess Session, Up: Top
1880
1881 6 Internet Chess Servers
1882 ************************
1883
1884 Based on the services provided above, there is also a special mode for
1885 communication with Internet Chess Servers.
1886
1887 On an Internet Chess Server you can seek to play against other human
1888 or computer players, observe other games being played or examined, play
1889 tournaments, chat with fellow chess players, participate in team games,
1890 or do various other interesting chess related things.
1891
1892 A default set of well known servers is defined in the following
1893 variable:
1894
1895 -- Variable: chess-ics-server-list
1896 A list of servers to connect to. The format of each entry is:
1897
1898 (SERVER PORT [HANDLE] [PASSWORD-OR-FILENAME] [HELPER] [HELPER
1899 ARGS...])
1900
1901 Internet Chess Servers based on FICS (Free Internet Chess Server)
1902 (http://www.freechess.org/) and ICC (Internet Chess Club)
1903 (http://www.chessclub.com/) are currently supported.
1904
1905 * Menu:
1906
1907 * Connecting to a server::
1908 * Chess ICS Mode::
1909 * Command History::
1910 * Seeking an opponent for a new game::
1911 * The sought game display::
1912 * Watching other games::
1913
1914 \1f
1915 File: chess.info, Node: Connecting to a server, Next: Chess ICS Mode, Up: Internet Chess Servers
1916
1917 6.1 Connecting to a server
1918 ==========================
1919
1920 To open a new connection to an Internet Chess Server, use:
1921
1922 -- Function: chess-ics server port &optional handle
1923 password-or-filename helper &rest helper-args
1924 Connect to an Internet Chess Server.
1925
1926 If called interactively, you will be prompted to enter a server
1927 (from ‘chess-ics-server-list’ and possibly identification
1928 credentials.
1929
1930 \1f
1931 File: chess.info, Node: Chess ICS Mode, Next: Command History, Prev: Connecting to a server, Up: Internet Chess Servers
1932
1933 6.2 Chess ICS Mode
1934 ==================
1935
1936 The major mode for ICS buffers is Chess ICS mode. Many of its special
1937 commands are bound to the ‘C-c’ prefix. Here is a list of ICS mode
1938 commands:
1939
1940 ‘<RET>’
1941 Send the current line as input to the server (‘comint-send-input’).
1942 Any prompt at the beginning of the line is omitted. If point is at
1943 the end of buffer, this is like submitting the command line in an
1944 ordinary interactive shell. However, you can also invoke <RET>
1945 elsewhere in the ICS buffer to submit the current line as input.
1946
1947 ‘C-d’
1948 Either delete a character or send EOF (End Of File)
1949 (‘comint-delchar-or-maybe-eof’). Typed at the end of the ICS
1950 buffer, this sends EOF to the server and terminates the connection.
1951 Typed at any other position in the buffer, this deletes the
1952 character at point, as usual.
1953
1954 ‘C-c C-a’
1955 Move to the beginning of the line, but after the prompt if any
1956 (‘comint-bol-or-process-mark’). If you repeat this command twice
1957 in a row, the second time it moves back to the process mark, which
1958 is the beginning of the input that you have not yet sent to the
1959 server. (Normally that is the same place—the end of the prompt on
1960 this line—but after ‘C-c <SPC>’ the process mark may be in a
1961 previous line.)
1962
1963 ‘C-c <SPC>’
1964 Accumulate multiple lines of input, then send them together
1965 (‘comint-accumulate’). This command inserts a newline before
1966 point, but does not send the preceding text as input to the
1967 server—at least, not yet. Both lines, the one before this newline
1968 and the one after, will be sent together (along with the newline
1969 that separates them), when you type <RET>.
1970
1971 ‘C-c C-u’
1972 Kill all text pending at end of buffer to be sent as input
1973 (‘comint-kill-input’). If point is not at end of buffer, this only
1974 kills the part of this text that precedes point.
1975
1976 ‘C-c C-w’
1977 Kill a word before point (‘backward-kill-word’).
1978
1979 ‘C-c C-o’
1980 Delete the last batch of output from an ICS server command
1981 (‘comint-delete-output’). This is useful if a server command spews
1982 out lots of output that just gets in the way.
1983
1984 ‘C-c C-s’
1985 Write the last batch of output from an ICS server command to a file
1986 (‘comint-write-output’). With a prefix argument, the file is
1987 appended to instead. Any prompt at the end of the output is not
1988 written.
1989
1990 ‘C-c C-r’
1991 ‘C-M-l’
1992 Scroll to display the beginning of the last batch of output at the
1993 top of the window; also move the cursor there
1994 (‘comint-show-output’).
1995
1996 ‘C-c C-e’
1997 Scroll to put the end of the buffer at the bottom of the window
1998 (‘comint-show-maximum-output’).
1999
2000 ‘M-x comint-truncate-buffer’
2001 This command truncates the ICS buffer to a certain maximum number
2002 of lines, specified by the variable ‘comint-buffer-maximum-size’.
2003 Here’s how to do this automatically each time you get output from
2004 the server:
2005
2006 (add-hook 'comint-output-filter-functions
2007 'comint-truncate-buffer)
2008
2009 ICS mode is a derivative of Comint mode, a general-purpose mode for
2010 communicating with interactive subprocesses. Most of the features of
2011 ICS mode actually come from Comint mode, as you can see from the command
2012 names listed above.
2013
2014 \1f
2015 File: chess.info, Node: Command History, Next: Seeking an opponent for a new game, Prev: Chess ICS Mode, Up: Internet Chess Servers
2016
2017 6.3 ICS Command History
2018 =======================
2019
2020 ICS buffers support two ways of repeating earlier commands. You can use
2021 keys like those used for the minibuffer history; these work much as they
2022 do in the minibuffer, inserting text from prior commands while point
2023 remains always at the end of the buffer. You can move through the
2024 buffer to previous inputs in their original place, then resubmit them or
2025 copy them to the end.
2026
2027 * Menu:
2028
2029 * ICS Command Ring::
2030 * ICS History Copying::
2031
2032 \1f
2033 File: chess.info, Node: ICS Command Ring, Next: ICS History Copying, Up: Command History
2034
2035 6.3.1 ICS Command History Ring
2036 ------------------------------
2037
2038 ‘M-p’
2039 ‘C-<UP>’
2040 Fetch the next earlier old ICS command (‘comint-previous-input’).
2041
2042 ‘M-n’
2043 ‘C-<DOWN>’
2044 Fetch the next later old ICS command (‘comint-next-input’).
2045
2046 ‘M-r’
2047 Begin an incremental regexp search of old ICS commands
2048 (‘comint-history-isearch-backward-regexp’).
2049
2050 ‘C-c C-x’
2051 Fetch the next subsequent command from the history
2052 (‘comint-get-next-from-history’).
2053
2054 ‘C-c .’
2055 Fetch one argument from an old ICS command
2056 (‘comint-input-previous-argument’).
2057
2058 ‘C-c C-l’
2059 Display the buffer’s history of ICS commands in another window
2060 (‘comint-dynamic-list-input-ring’).
2061
2062 ICS buffers provide a history of previously entered commands. To
2063 reuse commands from the history, use the editing commands ‘M-p’, ‘M-n’,
2064 ‘M-r’ and ‘M-s’. These work just like the minibuffer history commands
2065 (*note (emacs)Minibuffer History::), except that they operate within the
2066 ICS buffer rather than the minibuffer.
2067
2068 ‘M-p’ fetches an earlier ICS command to the end of the ICS buffer.
2069 Successive use of ‘M-p’ fetches successively earlier commands, each
2070 replacing any text that was already present as potential input. ‘M-n’
2071 does likewise except that it finds successively more recent ICS commands
2072 from the buffer. ‘C-<UP>’ works like ‘M-p’, and ‘C-<DOWN>’ like ‘M-n’.
2073
2074 The history search command ‘M-r’ begins an incremental regular
2075 expression search of previous ICS commands. After typing ‘M-r’, start
2076 typing the desired string or regular expression; the last matching ICS
2077 command will be displayed in the current line. Incremental search
2078 commands have their usual effects—for instance, ‘C-s’ and ‘C-r’ search
2079 forward and backward for the next match (*note (emacs)Incremental
2080 Search::). When you find the desired input, type <RET> to terminate the
2081 search. This puts the input in the command line. Any partial input you
2082 were composing before navigating the history list is restored when you
2083 go to the beginning or end of the history ring.
2084
2085 Often it is useful to reexecute several successive ICS commands that
2086 were previously executed in sequence. To do this, first find and
2087 reexecute the first command of the sequence. Then type ‘C-c C-x’; that
2088 will fetch the following command—the one that follows the command you
2089 just repeated. Then type <RET> to reexecute this command. You can
2090 reexecute several successive commands by typing ‘C-c C-x <RET>’ over and
2091 over.
2092
2093 The command ‘C-c .’ (‘comint-input-previous-argument’) copies an
2094 individual argument from a previous command, like ‘<ESC> .’ in Bash.
2095 The simplest use copies the last argument from the previous ICS command.
2096 With a prefix argument N, it copies the Nth argument instead. Repeating
2097 ‘C-c .’ copies from an earlier ICS command instead, always using the
2098 same value of N (don’t give a prefix argument when you repeat the ‘C-c
2099 .’ command).
2100
2101 These commands get the text of previous ICS commands from a special
2102 history list, not from the ICS buffer itself. Thus, editing the ICS
2103 buffer, or even killing large parts of it, does not affect the history
2104 that these commands access.
2105
2106 \1f
2107 File: chess.info, Node: ICS History Copying, Prev: ICS Command Ring, Up: Command History
2108
2109 6.3.2 ICS History Copying
2110 -------------------------
2111
2112 ‘C-c C-p’
2113 Move point to the previous prompt (‘comint-previous-prompt’).
2114
2115 ‘C-c C-n’
2116 Move point to the following prompt (‘comint-next-prompt’).
2117
2118 ‘C-c <RET>’
2119 Copy the input command at point, inserting the copy at the end of
2120 the buffer (‘comint-copy-old-input’). This is useful if you move
2121 point back to a previous command. After you copy the command, you
2122 can submit the copy as input with <RET>. If you wish, you can edit
2123 the copy before resubmitting it. If you use this command on an
2124 output line, it copies that line to the end of the buffer.
2125
2126 ‘Mouse-2’
2127 If ‘comint-use-prompt-regexp’ is ‘nil’ (the default), copy the old
2128 input command that you click on, inserting the copy at the end of
2129 the buffer (‘comint-insert-input’). If ‘comint-use-prompt-regexp’
2130 is non-‘nil’, or if the click is not over old input, just yank as
2131 usual.
2132
2133 Moving to a previous input and then copying it with ‘C-c <RET>’ or
2134 ‘Mouse-2’ produces the same results—the same buffer contents—that you
2135 would get by using ‘M-p’ enough times to fetch that previous input from
2136 the history list. However, ‘C-c <RET>’ copies the text from the buffer,
2137 which can be different from what is in the history list if you edit the
2138 input text in the buffer after it has been sent.
2139
2140 \1f
2141 File: chess.info, Node: Seeking an opponent for a new game, Next: The sought game display, Prev: Command History, Up: Internet Chess Servers
2142
2143 6.4 Seeking an opponent for a new game
2144 ======================================
2145
2146 After you connected to a server, one of the first things you will want
2147 to do is find an opponent for a new game. You can use the ICS command
2148 ‘seek’ to announce your availability for a chess game to interested
2149 people.
2150
2151 For example:
2152
2153 fics% seek 10 10 rated
2154
2155 This will announce your availability to play a rated game with 10
2156 minutes initial time-control for each player, and 10 seconds added for
2157 every move made.
2158
2159 \1f
2160 File: chess.info, Node: The sought game display, Next: Watching other games, Prev: Seeking an opponent for a new game, Up: Internet Chess Servers
2161
2162 6.5 The sought game display
2163 ===========================
2164
2165 There is a special mode for displaying games sought by other users on an
2166 Internet Chess Server. Provided you didn’t turn off seek advertisements
2167 manually (for instance by setting the seek variable to 0 (off) on the
2168 ICS server by issuing "set seek 0"), the first seek advertisement
2169 automatically pops up a new window which is in ‘chess-ics-ads-mode’, a
2170 derivative of ‘tabulated-list-mode’.
2171
2172 -- Function: chess-ics-ads-mode
2173 A mode for displaying ICS game seek advertisements.
2174
2175 This mode runs the hook ‘chess-ics-ads-mode-hook’, as the final
2176 step during initialization.
2177
2178 key binding — ——-
2179
2180 ? describe-mode RET chess-ics-sought-accept <mouse-2>
2181 chess-ics-sought-accept
2182
2183 In this buffer, use ‘mouse-2’ or ‘<RET>’ on a line to accept that
2184 particular game and play it.
2185
2186 \1f
2187 File: chess.info, Node: Watching other games, Prev: The sought game display, Up: Internet Chess Servers
2188
2189 6.6 Watching other games
2190 ========================
2191
2192 You can also watch other games currently being played on ICS. Even
2193 services like ‘LectureBot’ from FICS can be used.
2194
2195 fics% observe lecturebot
2196 You are now observing game 5.
2197 Game 5: LectureBot (0) LectureBot (0) unrated untimed 0 0
2198
2199 LectureBot(TD)(----)[5] kibitzes: (Note: A passed pawn is a pawn that
2200 does not have enemy pawns blocking the path either on the
2201 same or adjacent files).
2202 LectureBot(TD)(----)[5] kibitzes: Connected passed pawns are a pain to
2203 have to deal with. They are usually a winning advantage if
2204 they cannot be blockaded. The blockading piece has to give
2205 up duties elsewhere. It's almost like being a piece up.
2206 fics% unobserv lecturebot
2207 Removing game 5 from observation list.
2208 fics%
2209
2210 Once you start to observe a particular game or player, the current
2211 position will pop up in a chessboard display. As you are an observer,
2212 you will not be able to enter new moves. However, you should be able to
2213 navigate back and forth in the history of the game.
2214
2215 If a new move is made by any party in the game and you are currently
2216 displaying the last position in the game, the chessboard display will
2217 automatically update to reflect the new position and show the last move
2218 in the mode line.
2219
2220 \1f
2221 File: chess.info, Node: GNU Free Documentation License, Next: Concept Index, Prev: Internet Chess Servers, Up: Top
2222
2223 Appendix A GNU Free Documentation License
2224 *****************************************
2225
2226 Version 1.3, 3 November 2008
2227
2228 Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
2229 <http://fsf.org/>
2230
2231 Everyone is permitted to copy and distribute verbatim copies
2232 of this license document, but changing it is not allowed.
2233
2234 0. PREAMBLE
2235
2236 The purpose of this License is to make a manual, textbook, or other
2237 functional and useful document "free" in the sense of freedom: to
2238 assure everyone the effective freedom to copy and redistribute it,
2239 with or without modifying it, either commercially or
2240 noncommercially. Secondarily, this License preserves for the
2241 author and publisher a way to get credit for their work, while not
2242 being considered responsible for modifications made by others.
2243
2244 This License is a kind of “copyleft”, which means that derivative
2245 works of the document must themselves be free in the same sense.
2246 It complements the GNU General Public License, which is a copyleft
2247 license designed for free software.
2248
2249 We have designed this License in order to use it for manuals for
2250 free software, because free software needs free documentation: a
2251 free program should come with manuals providing the same freedoms
2252 that the software does. But this License is not limited to
2253 software manuals; it can be used for any textual work, regardless
2254 of subject matter or whether it is published as a printed book. We
2255 recommend this License principally for works whose purpose is
2256 instruction or reference.
2257
2258 1. APPLICABILITY AND DEFINITIONS
2259
2260 This License applies to any manual or other work, in any medium,
2261 that contains a notice placed by the copyright holder saying it can
2262 be distributed under the terms of this License. Such a notice
2263 grants a world-wide, royalty-free license, unlimited in duration,
2264 to use that work under the conditions stated herein. The
2265 “Document”, below, refers to any such manual or work. Any member
2266 of the public is a licensee, and is addressed as “you”. You accept
2267 the license if you copy, modify or distribute the work in a way
2268 requiring permission under copyright law.
2269
2270 A “Modified Version” of the Document means any work containing the
2271 Document or a portion of it, either copied verbatim, or with
2272 modifications and/or translated into another language.
2273
2274 A “Secondary Section” is a named appendix or a front-matter section
2275 of the Document that deals exclusively with the relationship of the
2276 publishers or authors of the Document to the Document’s overall
2277 subject (or to related matters) and contains nothing that could
2278 fall directly within that overall subject. (Thus, if the Document
2279 is in part a textbook of mathematics, a Secondary Section may not
2280 explain any mathematics.) The relationship could be a matter of
2281 historical connection with the subject or with related matters, or
2282 of legal, commercial, philosophical, ethical or political position
2283 regarding them.
2284
2285 The “Invariant Sections” are certain Secondary Sections whose
2286 titles are designated, as being those of Invariant Sections, in the
2287 notice that says that the Document is released under this License.
2288 If a section does not fit the above definition of Secondary then it
2289 is not allowed to be designated as Invariant. The Document may
2290 contain zero Invariant Sections. If the Document does not identify
2291 any Invariant Sections then there are none.
2292
2293 The “Cover Texts” are certain short passages of text that are
2294 listed, as Front-Cover Texts or Back-Cover Texts, in the notice
2295 that says that the Document is released under this License. A
2296 Front-Cover Text may be at most 5 words, and a Back-Cover Text may
2297 be at most 25 words.
2298
2299 A “Transparent” copy of the Document means a machine-readable copy,
2300 represented in a format whose specification is available to the
2301 general public, that is suitable for revising the document
2302 straightforwardly with generic text editors or (for images composed
2303 of pixels) generic paint programs or (for drawings) some widely
2304 available drawing editor, and that is suitable for input to text
2305 formatters or for automatic translation to a variety of formats
2306 suitable for input to text formatters. A copy made in an otherwise
2307 Transparent file format whose markup, or absence of markup, has
2308 been arranged to thwart or discourage subsequent modification by
2309 readers is not Transparent. An image format is not Transparent if
2310 used for any substantial amount of text. A copy that is not
2311 “Transparent” is called “Opaque”.
2312
2313 Examples of suitable formats for Transparent copies include plain
2314 ASCII without markup, Texinfo input format, LaTeX input format,
2315 SGML or XML using a publicly available DTD, and standard-conforming
2316 simple HTML, PostScript or PDF designed for human modification.
2317 Examples of transparent image formats include PNG, XCF and JPG.
2318 Opaque formats include proprietary formats that can be read and
2319 edited only by proprietary word processors, SGML or XML for which
2320 the DTD and/or processing tools are not generally available, and
2321 the machine-generated HTML, PostScript or PDF produced by some word
2322 processors for output purposes only.
2323
2324 The “Title Page” means, for a printed book, the title page itself,
2325 plus such following pages as are needed to hold, legibly, the
2326 material this License requires to appear in the title page. For
2327 works in formats which do not have any title page as such, “Title
2328 Page” means the text near the most prominent appearance of the
2329 work’s title, preceding the beginning of the body of the text.
2330
2331 The “publisher” means any person or entity that distributes copies
2332 of the Document to the public.
2333
2334 A section “Entitled XYZ” means a named subunit of the Document
2335 whose title either is precisely XYZ or contains XYZ in parentheses
2336 following text that translates XYZ in another language. (Here XYZ
2337 stands for a specific section name mentioned below, such as
2338 “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.)
2339 To “Preserve the Title” of such a section when you modify the
2340 Document means that it remains a section “Entitled XYZ” according
2341 to this definition.
2342
2343 The Document may include Warranty Disclaimers next to the notice
2344 which states that this License applies to the Document. These
2345 Warranty Disclaimers are considered to be included by reference in
2346 this License, but only as regards disclaiming warranties: any other
2347 implication that these Warranty Disclaimers may have is void and
2348 has no effect on the meaning of this License.
2349
2350 2. VERBATIM COPYING
2351
2352 You may copy and distribute the Document in any medium, either
2353 commercially or noncommercially, provided that this License, the
2354 copyright notices, and the license notice saying this License
2355 applies to the Document are reproduced in all copies, and that you
2356 add no other conditions whatsoever to those of this License. You
2357 may not use technical measures to obstruct or control the reading
2358 or further copying of the copies you make or distribute. However,
2359 you may accept compensation in exchange for copies. If you
2360 distribute a large enough number of copies you must also follow the
2361 conditions in section 3.
2362
2363 You may also lend copies, under the same conditions stated above,
2364 and you may publicly display copies.
2365
2366 3. COPYING IN QUANTITY
2367
2368 If you publish printed copies (or copies in media that commonly
2369 have printed covers) of the Document, numbering more than 100, and
2370 the Document’s license notice requires Cover Texts, you must
2371 enclose the copies in covers that carry, clearly and legibly, all
2372 these Cover Texts: Front-Cover Texts on the front cover, and
2373 Back-Cover Texts on the back cover. Both covers must also clearly
2374 and legibly identify you as the publisher of these copies. The
2375 front cover must present the full title with all words of the title
2376 equally prominent and visible. You may add other material on the
2377 covers in addition. Copying with changes limited to the covers, as
2378 long as they preserve the title of the Document and satisfy these
2379 conditions, can be treated as verbatim copying in other respects.
2380
2381 If the required texts for either cover are too voluminous to fit
2382 legibly, you should put the first ones listed (as many as fit
2383 reasonably) on the actual cover, and continue the rest onto
2384 adjacent pages.
2385
2386 If you publish or distribute Opaque copies of the Document
2387 numbering more than 100, you must either include a machine-readable
2388 Transparent copy along with each Opaque copy, or state in or with
2389 each Opaque copy a computer-network location from which the general
2390 network-using public has access to download using public-standard
2391 network protocols a complete Transparent copy of the Document, free
2392 of added material. If you use the latter option, you must take
2393 reasonably prudent steps, when you begin distribution of Opaque
2394 copies in quantity, to ensure that this Transparent copy will
2395 remain thus accessible at the stated location until at least one
2396 year after the last time you distribute an Opaque copy (directly or
2397 through your agents or retailers) of that edition to the public.
2398
2399 It is requested, but not required, that you contact the authors of
2400 the Document well before redistributing any large number of copies,
2401 to give them a chance to provide you with an updated version of the
2402 Document.
2403
2404 4. MODIFICATIONS
2405
2406 You may copy and distribute a Modified Version of the Document
2407 under the conditions of sections 2 and 3 above, provided that you
2408 release the Modified Version under precisely this License, with the
2409 Modified Version filling the role of the Document, thus licensing
2410 distribution and modification of the Modified Version to whoever
2411 possesses a copy of it. In addition, you must do these things in
2412 the Modified Version:
2413
2414 A. Use in the Title Page (and on the covers, if any) a title
2415 distinct from that of the Document, and from those of previous
2416 versions (which should, if there were any, be listed in the
2417 History section of the Document). You may use the same title
2418 as a previous version if the original publisher of that
2419 version gives permission.
2420
2421 B. List on the Title Page, as authors, one or more persons or
2422 entities responsible for authorship of the modifications in
2423 the Modified Version, together with at least five of the
2424 principal authors of the Document (all of its principal
2425 authors, if it has fewer than five), unless they release you
2426 from this requirement.
2427
2428 C. State on the Title page the name of the publisher of the
2429 Modified Version, as the publisher.
2430
2431 D. Preserve all the copyright notices of the Document.
2432
2433 E. Add an appropriate copyright notice for your modifications
2434 adjacent to the other copyright notices.
2435
2436 F. Include, immediately after the copyright notices, a license
2437 notice giving the public permission to use the Modified
2438 Version under the terms of this License, in the form shown in
2439 the Addendum below.
2440
2441 G. Preserve in that license notice the full lists of Invariant
2442 Sections and required Cover Texts given in the Document’s
2443 license notice.
2444
2445 H. Include an unaltered copy of this License.
2446
2447 I. Preserve the section Entitled “History”, Preserve its Title,
2448 and add to it an item stating at least the title, year, new
2449 authors, and publisher of the Modified Version as given on the
2450 Title Page. If there is no section Entitled “History” in the
2451 Document, create one stating the title, year, authors, and
2452 publisher of the Document as given on its Title Page, then add
2453 an item describing the Modified Version as stated in the
2454 previous sentence.
2455
2456 J. Preserve the network location, if any, given in the Document
2457 for public access to a Transparent copy of the Document, and
2458 likewise the network locations given in the Document for
2459 previous versions it was based on. These may be placed in the
2460 “History” section. You may omit a network location for a work
2461 that was published at least four years before the Document
2462 itself, or if the original publisher of the version it refers
2463 to gives permission.
2464
2465 K. For any section Entitled “Acknowledgements” or “Dedications”,
2466 Preserve the Title of the section, and preserve in the section
2467 all the substance and tone of each of the contributor
2468 acknowledgements and/or dedications given therein.
2469
2470 L. Preserve all the Invariant Sections of the Document, unaltered
2471 in their text and in their titles. Section numbers or the
2472 equivalent are not considered part of the section titles.
2473
2474 M. Delete any section Entitled “Endorsements”. Such a section
2475 may not be included in the Modified Version.
2476
2477 N. Do not retitle any existing section to be Entitled
2478 “Endorsements” or to conflict in title with any Invariant
2479 Section.
2480
2481 O. Preserve any Warranty Disclaimers.
2482
2483 If the Modified Version includes new front-matter sections or
2484 appendices that qualify as Secondary Sections and contain no
2485 material copied from the Document, you may at your option designate
2486 some or all of these sections as invariant. To do this, add their
2487 titles to the list of Invariant Sections in the Modified Version’s
2488 license notice. These titles must be distinct from any other
2489 section titles.
2490
2491 You may add a section Entitled “Endorsements”, provided it contains
2492 nothing but endorsements of your Modified Version by various
2493 parties—for example, statements of peer review or that the text has
2494 been approved by an organization as the authoritative definition of
2495 a standard.
2496
2497 You may add a passage of up to five words as a Front-Cover Text,
2498 and a passage of up to 25 words as a Back-Cover Text, to the end of
2499 the list of Cover Texts in the Modified Version. Only one passage
2500 of Front-Cover Text and one of Back-Cover Text may be added by (or
2501 through arrangements made by) any one entity. If the Document
2502 already includes a cover text for the same cover, previously added
2503 by you or by arrangement made by the same entity you are acting on
2504 behalf of, you may not add another; but you may replace the old
2505 one, on explicit permission from the previous publisher that added
2506 the old one.
2507
2508 The author(s) and publisher(s) of the Document do not by this
2509 License give permission to use their names for publicity for or to
2510 assert or imply endorsement of any Modified Version.
2511
2512 5. COMBINING DOCUMENTS
2513
2514 You may combine the Document with other documents released under
2515 this License, under the terms defined in section 4 above for
2516 modified versions, provided that you include in the combination all
2517 of the Invariant Sections of all of the original documents,
2518 unmodified, and list them all as Invariant Sections of your
2519 combined work in its license notice, and that you preserve all
2520 their Warranty Disclaimers.
2521
2522 The combined work need only contain one copy of this License, and
2523 multiple identical Invariant Sections may be replaced with a single
2524 copy. If there are multiple Invariant Sections with the same name
2525 but different contents, make the title of each such section unique
2526 by adding at the end of it, in parentheses, the name of the
2527 original author or publisher of that section if known, or else a
2528 unique number. Make the same adjustment to the section titles in
2529 the list of Invariant Sections in the license notice of the
2530 combined work.
2531
2532 In the combination, you must combine any sections Entitled
2533 “History” in the various original documents, forming one section
2534 Entitled “History”; likewise combine any sections Entitled
2535 “Acknowledgements”, and any sections Entitled “Dedications”. You
2536 must delete all sections Entitled “Endorsements.”
2537
2538 6. COLLECTIONS OF DOCUMENTS
2539
2540 You may make a collection consisting of the Document and other
2541 documents released under this License, and replace the individual
2542 copies of this License in the various documents with a single copy
2543 that is included in the collection, provided that you follow the
2544 rules of this License for verbatim copying of each of the documents
2545 in all other respects.
2546
2547 You may extract a single document from such a collection, and
2548 distribute it individually under this License, provided you insert
2549 a copy of this License into the extracted document, and follow this
2550 License in all other respects regarding verbatim copying of that
2551 document.
2552
2553 7. AGGREGATION WITH INDEPENDENT WORKS
2554
2555 A compilation of the Document or its derivatives with other
2556 separate and independent documents or works, in or on a volume of a
2557 storage or distribution medium, is called an “aggregate” if the
2558 copyright resulting from the compilation is not used to limit the
2559 legal rights of the compilation’s users beyond what the individual
2560 works permit. When the Document is included in an aggregate, this
2561 License does not apply to the other works in the aggregate which
2562 are not themselves derivative works of the Document.
2563
2564 If the Cover Text requirement of section 3 is applicable to these
2565 copies of the Document, then if the Document is less than one half
2566 of the entire aggregate, the Document’s Cover Texts may be placed
2567 on covers that bracket the Document within the aggregate, or the
2568 electronic equivalent of covers if the Document is in electronic
2569 form. Otherwise they must appear on printed covers that bracket
2570 the whole aggregate.
2571
2572 8. TRANSLATION
2573
2574 Translation is considered a kind of modification, so you may
2575 distribute translations of the Document under the terms of section
2576 4. Replacing Invariant Sections with translations requires special
2577 permission from their copyright holders, but you may include
2578 translations of some or all Invariant Sections in addition to the
2579 original versions of these Invariant Sections. You may include a
2580 translation of this License, and all the license notices in the
2581 Document, and any Warranty Disclaimers, provided that you also
2582 include the original English version of this License and the
2583 original versions of those notices and disclaimers. In case of a
2584 disagreement between the translation and the original version of
2585 this License or a notice or disclaimer, the original version will
2586 prevail.
2587
2588 If a section in the Document is Entitled “Acknowledgements”,
2589 “Dedications”, or “History”, the requirement (section 4) to
2590 Preserve its Title (section 1) will typically require changing the
2591 actual title.
2592
2593 9. TERMINATION
2594
2595 You may not copy, modify, sublicense, or distribute the Document
2596 except as expressly provided under this License. Any attempt
2597 otherwise to copy, modify, sublicense, or distribute it is void,
2598 and will automatically terminate your rights under this License.
2599
2600 However, if you cease all violation of this License, then your
2601 license from a particular copyright holder is reinstated (a)
2602 provisionally, unless and until the copyright holder explicitly and
2603 finally terminates your license, and (b) permanently, if the
2604 copyright holder fails to notify you of the violation by some
2605 reasonable means prior to 60 days after the cessation.
2606
2607 Moreover, your license from a particular copyright holder is
2608 reinstated permanently if the copyright holder notifies you of the
2609 violation by some reasonable means, this is the first time you have
2610 received notice of violation of this License (for any work) from
2611 that copyright holder, and you cure the violation prior to 30 days
2612 after your receipt of the notice.
2613
2614 Termination of your rights under this section does not terminate
2615 the licenses of parties who have received copies or rights from you
2616 under this License. If your rights have been terminated and not
2617 permanently reinstated, receipt of a copy of some or all of the
2618 same material does not give you any rights to use it.
2619
2620 10. FUTURE REVISIONS OF THIS LICENSE
2621
2622 The Free Software Foundation may publish new, revised versions of
2623 the GNU Free Documentation License from time to time. Such new
2624 versions will be similar in spirit to the present version, but may
2625 differ in detail to address new problems or concerns. See
2626 <http://www.gnu.org/copyleft/>.
2627
2628 Each version of the License is given a distinguishing version
2629 number. If the Document specifies that a particular numbered
2630 version of this License “or any later version” applies to it, you
2631 have the option of following the terms and conditions either of
2632 that specified version or of any later version that has been
2633 published (not as a draft) by the Free Software Foundation. If the
2634 Document does not specify a version number of this License, you may
2635 choose any version ever published (not as a draft) by the Free
2636 Software Foundation. If the Document specifies that a proxy can
2637 decide which future versions of this License can be used, that
2638 proxy’s public statement of acceptance of a version permanently
2639 authorizes you to choose that version for the Document.
2640
2641 11. RELICENSING
2642
2643 “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any
2644 World Wide Web server that publishes copyrightable works and also
2645 provides prominent facilities for anybody to edit those works. A
2646 public wiki that anybody can edit is an example of such a server.
2647 A “Massive Multiauthor Collaboration” (or “MMC”) contained in the
2648 site means any set of copyrightable works thus published on the MMC
2649 site.
2650
2651 “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0
2652 license published by Creative Commons Corporation, a not-for-profit
2653 corporation with a principal place of business in San Francisco,
2654 California, as well as future copyleft versions of that license
2655 published by that same organization.
2656
2657 “Incorporate” means to publish or republish a Document, in whole or
2658 in part, as part of another Document.
2659
2660 An MMC is “eligible for relicensing” if it is licensed under this
2661 License, and if all works that were first published under this
2662 License somewhere other than this MMC, and subsequently
2663 incorporated in whole or in part into the MMC, (1) had no cover
2664 texts or invariant sections, and (2) were thus incorporated prior
2665 to November 1, 2008.
2666
2667 The operator of an MMC Site may republish an MMC contained in the
2668 site under CC-BY-SA on the same site at any time before August 1,
2669 2009, provided the MMC is eligible for relicensing.
2670
2671 ADDENDUM: How to use this License for your documents
2672 ====================================================
2673
2674 To use this License in a document you have written, include a copy of
2675 the License in the document and put the following copyright and license
2676 notices just after the title page:
2677
2678 Copyright (C) YEAR YOUR NAME.
2679 Permission is granted to copy, distribute and/or modify this document
2680 under the terms of the GNU Free Documentation License, Version 1.3
2681 or any later version published by the Free Software Foundation;
2682 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
2683 Texts. A copy of the license is included in the section entitled ``GNU
2684 Free Documentation License''.
2685
2686 If you have Invariant Sections, Front-Cover Texts and Back-Cover
2687 Texts, replace the “with…Texts.” line with this:
2688
2689 with the Invariant Sections being LIST THEIR TITLES, with
2690 the Front-Cover Texts being LIST, and with the Back-Cover Texts
2691 being LIST.
2692
2693 If you have Invariant Sections without Cover Texts, or some other
2694 combination of the three, merge those two alternatives to suit the
2695 situation.
2696
2697 If your document contains nontrivial examples of program code, we
2698 recommend releasing these examples in parallel under your choice of free
2699 software license, such as the GNU General Public License, to permit
2700 their use in free software.
2701
2702 \1f
2703 File: chess.info, Node: Concept Index, Next: Function and Variable Index, Prev: GNU Free Documentation License, Up: Top
2704
2705 Concept Index
2706 *************
2707
2708