Updating to version 1.3.2, last public release by Mike Vanier.
[gnushogi.git] / doc / gnushogi.info-2
1 This is gnushogi.info, produced by makeinfo version 4.3 from
2 gnushogi.texinfo.
3
4    This file describes how to use GNU shogi, a program which plays
5 Shogi (Japanese chess).
6
7    Copyright (C) 1999 Michael C. Vanier and the Free Software
8 Foundation, Inc.
9
10    Permission is granted to make and distribute verbatim copies of this
11 manual provided the copyright notice and this permission notice are
12 preserved on all copies.
13
14    Permission is granted to copy and distribute modified versions of
15 this manual under the conditions for verbatim copying, provided that
16 the entire resulting derived work is distributed under the terms of a
17 permission notice identical to this one.
18
19    Permission is granted to copy and distribute translations of this
20 manual into another language, under the above conditions for modified
21 versions, except that this permission notice may be stated in a
22 translation approved by the Free Software Foundation.
23
24 \1f
25 File: gnushogi.info,  Node: Mating problems,  Next: Shogi variants,  Prev: Sample game,  Up: About shogi
26
27 Mating problems
28 ===============
29
30    One good way to improve at shogi is to solve mating problems.  There
31 are several types of these problems, but the most common is called a
32 "tsume-shogi" problem, or "tsume" problem for short.  In a tsume
33 problem, all pieces that are not on the board are assumed to be in the
34 opponent's hand (except for your King, which is usually not shown).
35 Every move you make must be check until the final checkmate.  Your
36 opponent may play any piece on the board or drop any of his pieces in
37 hand in order to prevent the mate.  In a properly constructed tsume
38 problem, all of your pieces on the board and in hand must be essential
39 to the solution.  One consequence of this is that all of your pieces in
40 hand must be played during the solution.  There should only be one
41 correct solution for the given number of moves.  Tsume problems use
42 Japanese-style move numbering; thus, a problem where you move (and give
43 check), your opponent moves, and you move to give checkmate is called a
44 three-mover.  Here is a really trivial three-mover:
45
46
47    3    2    1
48 ---------------+
49 |    |    |    |  a
50 ---------------+
51 |    |    | wK |  b
52 ---------------+
53 |    |    |    |  c
54 ---------------+
55 | bN |    |    |  d
56 ---------------+
57 |    |    |    |  e
58 ---------------+
59 |    | bN |    |  f
60 ---------------+
61
62 Black in hand: S, G
63
64
65    Here, Black plays G*2b, White plays K1c, and Black plays G*1d mate.
66 More typical tsume problems range from 5 moves to arbitrarily high
67 numbers of moves, and they can be quite brain-busting.  Tsume problems
68 may seem artificial, but in the closing stages of the game where both
69 players have a lot of pieces in hand, it is often necessary to give
70 check at every move, or else your opponent will start a counterattack
71 and will mate you before you mate him.  A tsume problem is a worst-case
72 scenario for the attacker: you have to mate your opponent even though he
73 has every piece not on the board in hand, which means you have to
74 develop sharp attacking skills.  Many more tsume problems can be found
75 on the internet; I particularly recommend Patrick Davin's "Shogi Nexus"
76 (*note References and links::).
77
78 \1f
79 File: gnushogi.info,  Node: Shogi variants,  Next: Differences between shogi and chess,  Prev: Mating problems,  Up: About shogi
80
81 Shogi variants
82 ==============
83
84    Several historical variants of shogi exist.  Most of these were
85 invented before modern shogi (in some cases hundreds of years before),
86 are much larger than modern shogi and are not played with drops.  Thus,
87 in many ways they are really more like giant chess games than like
88 modern shogi.  The only one of these games to have survived in Japan is
89 Chu (middle) shogi, which is still played a little bit.  Thanks to the
90 efforts of George Hodges and John Fairbairn of the Shogi Association
91 (two British shogi enthusiasts), these games were resurrected and rules
92 and sets for them can still be purchased from George Hodges (*note
93 References and links::).  I hope to eventually extend GNU shogi so that
94 it can play at least some of these games.  There are also several
95 non-historical variants of shogi; I don't know much about them but you
96 can find information about them on the internet (*note References and
97 links::).
98
99    The historical variants include:
100
101
102   1. Tori (bird) shogi, played on a 7x7 board with 32 pieces in all;
103      this is the only variant that is known to have been played with
104      drops.
105
106   2. Wa shogi, played on an 11x11 board with 54 pieces.  This game can
107      be played with or without drops but the historical evidence favors
108      the view that it was played without drops.  However, most people
109      who have tried it claim it is a much better game with drops, being
110      even more intricate than standard shogi.
111
112   3. Chu (middle) shogi, played on a 12x12 board with 92 pieces.  This
113      was (and is) by far the most popular of the variants, and has 21
114      different kinds of pieces in the starting line-up alone (along
115      with several others that appear upon promotion).  Unlike modern
116      shogi, there are a tremendous number of ranging pieces and the
117      game is definitely not played with drops.  There is also an
118      amazing piece called the Lion which has a double king move and can
119      capture two pieces at once!  Chu shogi has a small but fanatical
120      following, some of whom consider it better than modern shogi.
121
122   4. Dai (great) shogi, played on a 15x15 board with 130 pieces.  Other
123      than the larger board, this game is very similar to Chu shogi.
124
125   5. Tenjiku (exotic) shogi, played on a 16x16 board with 176 pieces.
126      This game is possibly the most complex tactical game in existence.
127      There are many astoundingly powerful pieces, including one (the
128      Fire Demon) that can capture up to eight opposing pieces in a
129      single move!  Despite the size of the game, checkmates can occur
130      very suddenly (and often very early on) if one player makes a
131      wrong move.  Tenjiku also has a small but fanatical following, one
132      of whom (Colin Adams) has written a book on the game which is
133      available for download at
134      `http://www.colina.demon.co.uk/tenjiku.html'.
135
136   6. Dai-dai (great-great) shogi, played on a 17x17 board with 192
137      pieces.  The opening setup alone has 64 different kinds of pieces!
138      This game and the larger ones that follow sound pretty
139      outlandish, but they have actually been played; a game of Dai-dai
140      can supposedly be played in about 12 hours.
141
142   7. Maka-dai-dai (great-great-great) shogi, played on a 19x19 board
143      with 192 pieces.  For those for whom Dai-dai shogi is just too
144      small :-)
145
146   8. Tai (grand) shogi, played on a 25x25 board with 354 pieces!  Until
147      recently, this was thought to be the biggest chess game ever
148      devised, but now there is...
149
150   9. Kyoku tai (extremely grand?) shogi, played on a 36x36 board with
151      402 pieces.  The rules for this have just been unearthed in an old
152      Japanese book.  Hopefully someone will soon organize a postal
153      Kyoku tai shogi championship; maybe their distant ancestors could
154      finish it :-)
155
156      It is thought that the really huge games (Dai-dai and up) were
157      never really played to any significant extent (gee, wonder why?)
158      and were devised merely so that the creators could have the fun of
159      inventing enormous games, amazing their friends and confounding
160      their enemies.  However, the games up to Tenjiku shogi at least
161      appear to be quite playable, assuming one has the time.
162
163
164
165 \1f
166 File: gnushogi.info,  Node: Differences between shogi and chess,  Prev: Shogi variants,  Up: About shogi
167
168 Differences between shogi and chess
169 ===================================
170
171    Some differences between shogi and international chess have been
172 mentioned elsewhere in this document; I summarize them here for people
173 who are interested in game comparisons.  I won't try to deal with the
174 thorny question of which game is "better" although my bias may have
175 already come through :-) In fact, the drop rule makes the two games so
176 different in character that arguing over which game is better is like
177 comparing apples to oranges (you'd be better off comparing chess to Chu
178 shogi (*note Shogi variants::).  However, I believe that if you are a
179 chess fan you'll really like shogi as well, and shogi is also popular
180 with many people who don't particularly like chess.
181
182    Here are the significant differences between chess and shogi:
183
184
185   1. In shogi, captured pieces become the property of the capturer and
186      can re-enter play by being dropped onto almost any vacant square.
187      In chess, captured pieces are out of the game.  Thus, in shogi,
188      piece exchanges complicate the play significantly while in chess
189      they simplify it.
190
191   2. The shogi board is 9x9; the chess board is 8x8.
192
193   3. Shogi has five pieces with no counterpart in chess: the gold and
194      silver generals, the lance, the promoted rook and the promoted
195      bishop.  Chess has one piece with no counterpart in shogi: the
196      queen.  The knight's move in shogi is much more restrictive than
197      in chess.  Pieces in shogi generally have a much smaller range of
198      movement than in chess (unless they are in hand).
199
200   4. In shogi, all pieces except the gold general and the king can
201      promote, but only to one kind of piece.  Promotion is easier in
202      shogi because the promotion zone is closer to the starting
203      position of the pieces (especially pawns).  In chess, only the
204      pawn can promote, but it can promote to any other piece except the
205      king.
206
207   5. In shogi, pawns capture the same way they move.  There is no
208      initial two-space pawn move and hence no _en-passant_ captures.
209      In chess, pawns capture diagonally which means that opposing pawns
210      can block each other.
211
212   6. In shogi, you only have one rook and one bishop.  Note that the
213      bishop is not restricted to only one "color" square (squares in
214      shogi aren't colored, but never mind) because promoted bishops can
215      also move one square orthogonally.
216
217   7. There is no special castling move in shogi.  The term "castle" is
218      used in shogi to denote a defensive formation consisting of
219      (usually) three generals which protect the king.  There are many
220      such castles (about 40 or so have names).  *Note Sample game::.
221
222   8. Draws are much rarer in shogi than in chess.  Perpetual check is
223      not allowed.  Stalemate is a virtual impossibility, and is a loss
224      for the stalematee.
225
226   9. Since pieces are never out of play in shogi, chess-type endgames
227      involving only a few pieces do not occur.
228
229  10. Shogi games are generally longer than chess games (about 60-70
230      moves is typical).
231
232  11. Shogi has a well-developed handicap system which is in general use;
233      chess does not.
234
235
236
237    The effects of all these differences on play include (in my opinion):
238
239
240   1. Piece/pawn structures in chess are more rigid than in shogi.  Pawns
241      block each other and pawns, once advanced, cannot ever retreat.  In
242      shogi, you can repair the hole caused by a pawn advance by
243      exchanging the pawn and dropping it back where you want it.  Thus
244      shogi is more fluid than chess and less "structural".
245
246   2. Counterattack is MUCH more common in shogi than in chess.  Games
247      typically end in mutual mating attacks, where each player is
248      trying to checkmate the other player before being checkmated
249      himself.  This makes tempo incredibly important and also makes
250      sacrificial play quite common.
251
252   3. Attacks involving only ranging pieces are more a feature of chess
253      than of shogi.  A shogi attack typically uses a ranging piece or
254      pieces to support an attack by short-range pieces (especially
255      generals).  It is very rare to mate a king with a non-adjacent
256      ranging piece in shogi since the player whose king is threatened
257      can almost always interpose by dropping a piece.
258
259
260
261 \1f
262 File: gnushogi.info,  Node: gnushogi,  Next: xshogi,  Prev: About shogi,  Up: Top
263
264 gnushogi
265 ********
266
267    This section describes how to run the "gnushogi" program.
268
269
270    SYNOPSIS
271
272
273    gnushogi [ [[-]a] [-b bookfile] [-B binbookfile] [-C] [-h langfile]
274 [-L langfile] [-r length] [-R] [-s pathname] [-l pathname] [-S
275 binbooksize] [-t] [-c size] [-T size] [-v] [-x] [-X] arg1 arg2 ]
276
277
278    DESCRIPTION
279
280
281    GNU shogi (gnushogi) plays a game of japanese chess (shogi) against
282 the user or it plays against itself.
283
284    At startup gnushogi reads the binbook file if it is present.  It then
285 looks for a book file.  If it is present it adds its contents to the
286 binbook data.  If the binbook file is writable a new combined binbook
287 file is written.
288
289    Gnushogi is a modified version of the gnuchess program.  It has a
290 simple alphanumeric board display, or it can be used with the xshogi
291 program under X windows.  The program gets its opening moves from the
292 file gnushogi.bbk which is located in a directory specified in the
293 Makefile.  To invoke the program type:
294
295
296 `gnushogi -C'
297      simple curses based version
298
299 `gnushogi -X (or just gnushogi)'
300      xshogi compatible version
301
302 `gnushogi -R'
303      raw test display version
304
305
306    TIME CONTROLS
307
308
309    If one argument is given, it is the search time per move in
310 [minutes:]seconds.  So gnushogi 30 will generate one move every 30
311 seconds, while gnushogi 5:00 will generate one move every 5 minutes.
312
313    If two or more arguments are given, they will be used to set
314 tournament time controls with the first argument of each pair being the
315 number of moves and the second being the total clock time in
316 minutes[:seconds].  Thus, entering gnushogi 60 5 will set the clocks
317 for 5 minutes (300 seconds) for the first 60 moves, and gnushogi 30
318 3:30 will allow 3 minutes and 30 seconds for 30 moves.
319
320    gnushogi 30 5 1 :30 will allow 5 minutes for the first 30 moves and
321 30 seconds for each move after that.  Up to 4 pairs of controls may be
322 specified.
323
324    If no argument is given the program will prompt the user for level of
325 play.
326
327    For use with xshogi see the documentation on that program.  *Note
328 xshogi::.
329
330
331    BOOK
332
333
334    The book gnushogi.tbk consists of a sequence of openings.  An opening
335 begins with a line starting with a # (the rest of the line is a
336 comment).  Following this is a series of moves in algebraic notation
337 alternating between black and white separated by whitespace.  A move
338 may have a ?  after it indicating this move should never be made in
339 this position.  Moves are stored as position:move so transpositions
340 between openings can take place.
341
342
343    HASHFILE
344
345
346    The hashfile if created should be on the order of 4 megabytes; you
347 can create such a hashfile by typing "gnushogi -c 22" (see below).  This
348 file contains positions and moves learned from previous games.  If a
349 hashfile is used the computer makes use of the experience it gained in
350 past games.  Tests run so far show that it plays no worse with the
351 hashfile than without, but it is not clear yet whether it provides a
352 real advantage.
353
354
355    LEGAL MOVES
356
357
358    Note: Piece letters are determined by the language file.  What is
359 specified here is the default (English).
360
361    Once gnushogi is invoked, the program will display the board and
362 prompt the user for a move.  To enter a move, use the notation 7g7f
363 where the first letter-number pair indicates the origin square and the
364 second letter-number pair indicates the destination square.  An
365 alternative is to use the notation P7f where the first letter indicates
366 the piece type (P,L,N,S,G,B,R,K).  To promote append a + the type of
367 the new piece to the move, as in 2d2c+ or P2c+. Note that you must use
368 capital letters for the pieces by default.
369
370
371    COMMAND-LINE OPTIONS
372
373
374 `-a'
375      Do not search on opponent's time.
376
377 `a'
378      Do search on opponent's time.
379
380 `-b BOOKFILE'
381      Use bookfile for opening book.
382
383 `-B BINBOOKFILE'
384      Use binbookfile for binary opening book.
385
386 `-c SIZE'
387      Create a new HASHFILE.  File size is 2^size entries of
388      approximately 65+?  bytes.
389
390 `-C'
391      Use curses-based display mode.
392
393 `-h'
394      Do not use hashfile.
395
396 `h'
397      Do use hashfile.
398
399 `-l PATHNAME'
400      Pathname of the loadfile used with get or xget.
401
402 `-L LANG'
403      Use language lang from the file gnushogi.lang.  If -L is not
404      specified it uses the first language in the file.
405
406 `-P PLYLEVELS'
407      Number of plys to include in the binbookfile.  For generating a
408      binbookfile.
409
410 `-r LENGTH'
411      Rehash _length_ times in searching entries for position in
412      transposition table.
413
414 `-R'
415      Use raw text display mode.  This can be used for dumb terminals or
416      for systems that don't have curses.
417
418 `-s PATHNAME'
419      Pathname of the save file to use with the save command.
420
421 `-S SIZE'
422      Size of binbookfile for memory based books.  For creating a
423      binbookfile.
424
425 `-t'
426      Show statistics for HASHFILE.
427
428 `-T SIZE'
429      Set the transposition table size to 2^size entries.
430
431 `-v'
432      Show version and patchlevel.
433
434 `-x VALUE'
435      Use value as the evaluation window xwndw.
436
437 `-X'
438      Use xshogi display mode (the default).
439
440
441    COMMANDS
442
443
444    In addition to legal moves, the following commands can be entered at
445 the gnushogi prompt.  Note: command names are determined by the language
446 file and may vary with the implementation.  The default language is
447 English.
448
449 `alg'
450      allow algebraic input (not implemented).
451
452 `Awindow'
453      change Alpha window (default score + 90).
454
455 `Bwindow'
456      change Beta window (default score - 90).
457
458 `beep'
459      toggles beeping after each move (default: on).
460
461 `bd'
462      updates the current board position on the display.
463
464 `book'
465      turns off use of the opening library.
466
467 `both'
468      causes the computer to play both sides of a shogi game.
469
470 `black'
471      causes the computer to play as White, if the computer was to move
472      first.
473
474 `bsave'
475      saves a game to disk as a book textfile.  The program will prompt
476      the user for a file name.
477
478 `gamein'
479      toggles game mode time control.  Assumes the time specified for
480      time control is the time for a complete game.  Input with the
481      level command should be the game time and the expected number of
482      moves in a game.  go command must be given.
483
484 `coords'
485      show coordinates on the display (visual only).
486
487 `contempt'
488      allows the value of _contempt_ to be modified.
489
490 `debug'
491      asks for a piece as color piece, as wb or bn, and shows its
492      calculated value on each square.
493
494 `debuglevel'
495      sets level of debugging output if compiled with debug options.
496
497 `depth'
498      allows the user to change the search depth of the program.  The
499      maximum depth is 29 ply.  Normally the depth is set to 29 and the
500      computer terminates its search based on elapsed time rather than
501      depth.  If depth is set to (say) 4 ply, the program will search
502      until all moves have been examined to a depth of 4 ply (with
503      extensions up to 11 additional ply for sequences of checks and
504      captures).  If you set a maximum time per move and also use the
505      depth command, the search will stop at the specified time or the
506      specified depth, whichever comes first.
507
508 `easy'
509      toggles easy mode (thinking on opponents time) on and off. The
510      default is easy mode ON.  If easy mode is disabled, the keyboard
511      is polled for input every so often and when input is seen the
512      search is terminated. It may also be terminated with a sigint.
513
514 `edit'
515      allows the user to set up a board position.
516         - # clear the board.
517
518         - c toggle piece color.
519
520         - .  command will exit setup mode.
521
522         - p3b place a pawn on 3b
523
524         - p3b+ place a promoted pawn on 3b
525
526         - p* place a pawn in hand (among the captured pieces)
527
528
529      Pieces are entered by typing a letter (p,l,n,s,g,b,r,k)  for the
530      piece followed by the coordinate.  Here, letter case is ignored.
531
532      The usual warning about the language file applies.
533
534 `exit'
535      exits gnushogi.
536
537 `first'
538      tells the computer to move first.  Computer begins searching for a
539      move.  (same as "go").
540
541 `force'
542      allows the user to enter moves for both sides.  To get the program
543      to play after a sequence of moves has been entered use the "black"
544      or "white" commands.
545
546 `get'
547      retrieves a game from disk.  The program will prompt the user for
548      a file name.
549
550 `go'
551      tells the computer to move first.  Computer begins searching for a
552      move.  (same as "first").
553
554 `hash'
555      use/don't use hashfile.
556
557 `hashdepth'
558      allows the user to change the minimum depth for using the hashfile
559      and the number of moves from the beginning of the game to use it.
560
561 `help'
562      displays a short description of the commands and the current
563      status of options.
564
565 `hint'
566      causes the program to supply the user with its predicted move.
567
568 `level'
569      allows the user to set time controls such as 60 moves in 5 minutes
570      etc.  In tournament mode, the program will vary the time it takes
571      for each move depending on the situation.  If easy mode is
572      disabled (using the "easy" command), the program will often
573      respond with its move immediately, saving time on its clock for
574      use later on.
575
576 `list'
577      writes the game moves and some statistics on search depth, nodes,
578      and time to the file "shogi.lst".
579
580 `material'
581      toggle material flag - draws on no pawns and both sides < rook.
582
583 `new'
584      starts a new game.
585
586 `p'
587      evaluates the board and shows the point score for each piece.  The
588      total score for a position is the sum of these individual piece
589      scores.
590
591 `post'
592      causes the program to display the principal variation and the score
593      during the search.  A score of 100 is equivalent to a 1 pawn
594      advantage for the computer.
595
596 `quit'
597      exits the game.
598
599 `random'
600      causes the program to randomize its move selection slightly.
601
602 `rcptr'
603      set recapture mode.
604
605 `remove'
606      backout the last level for both sides.  Equal to 2 undo's.
607
608 `reverse'
609      causes the board display to be reversed.  That is, the Black's
610      pieces will now appear at the top of the board.
611
612 `rv'
613      reverse board display.
614
615 `save'
616      saves a game to disk.  The program will prompt the user for a file
617      name.
618
619 `switch'
620      causes the program to switch places with the opponent and begin
621      searching.
622
623 `test'
624      performs some speed tests for MoveList and CaptureList generation,
625      and ScorePosition position scoring for the current board.
626
627 `time'
628      set computer's time remaining, intended for synchronizing clocks
629      among multiple players.
630
631 `tsume'
632      toggle tsume mode. In tsume mode, not all possible moves will be
633      generated. If a king is in check, only moves that get the king out
634      of check are generated.  If the king is not in check, only moves
635      that give check to the opponent's king are generated.
636
637 `undo'
638      undoes the last move whether it was the computer's or the human's.
639      You may also type "remove".  This is equivalent to two "undo"'s
640      (e.g. retract one move for each side).
641
642 `white'
643      causes the computer to play as Black; if the computer is to move
644      first the go command must be given.
645
646 `xget'
647      read an xshogi position file.
648
649 `xsave'
650      save as an xshogi position file.
651
652 `xwndw'
653      change X window. The window around alpha/beta used to determine
654      whether the position should be scored or just estimated.  Note:
655      this has _nothing_ to do with xshogi or X windows; the terms are
656      completely separate.
657
658
659 \1f
660 File: gnushogi.info,  Node: xshogi,  Next: References and links,  Prev: gnushogi,  Up: Top
661
662 xshogi
663 ******
664
665    This section describes how to run the "xshogi" program.
666
667
668    SYNOPSIS
669
670
671    xshogi [ options ]
672
673
674    DESCRIPTION
675
676
677    xshogi provides an X11/Xt/Athena Widgets user interface for gnushogi.
678 With xshogi you can play gnushogi, set up arbitrary positions, force
679 variations, or watch xshogi manage a game between two shogi programs.
680 Furthermore, it can be used as an interface between two players on
681 different displays.
682
683    xshogi can also be used as a shogi board to play out games.  It will
684 read through a game file or allow a player to play through a variation
685 manually (force mode).  This is useful for keeping track of email postal
686 games or browsing games off the net.
687
688    After starting xshogi, you can make moves by pressing mouse button 1
689 while the cursor is over a square with your piece on it and dragging the
690 mouse to another square.  If the move is illegal, gnushogi will not
691 allow it.  xshogi will then retract the move.
692
693
694    COMMAND-LINE OPTIONS
695
696
697    The following command line options also correspond to X resources
698 that you can set in your .Xdefaults file.
699
700
701 `[standard Xt options]'
702      xshogi accepts standard Xt options like -display, -geometry, and
703      -iconic.
704
705 `-tc or -timeControl minutes[:seconds]'
706      Amount of time for a set of moves determined by movesPerSession.
707      If this number of moves is played within the time control period,
708      xshogi resets the time clocks.  Default: 5 minutes.
709
710 `-mps or -movesPerSession moves'
711      Number of moves in a time control period.  Default: 40 moves.
712
713 `-st or -searchTime minutes[:seconds]'
714      Tell gnushogi to spend at most the given amount of time searching
715      for each of its moves.  Without this option, gnushogi chooses its
716      search time based on the number of moves and amount of time
717      remaining until the next time control.  Setting this option also
718      sets -clockMode to False.
719
720 `-sd or -searchDepth number'
721      Tell gnushogi to look ahead at most the given number of moves when
722      searching for a move to make.  Without this option, gnushogi
723      chooses its search depth based on the number of moves and amount
724      of time remaining until the next time control.  Setting this
725      option also sets -clockMode to False.
726
727 `-clock or -clockMode (True | False)'
728      Determines whether or not to use the clock.  If clockMode is
729      False, the clock does not run, but the side that is to play next
730      is still highlighted.
731
732 `-td or -timeDelay seconds'
733      Time delay between moves during "Load Game".  This doesn't have to
734      be a round number.  Try -td 0.4.  Default: 1 second.
735
736 `-nsp or -noShogiProgram (True | False)'
737      If this option is True, xshogi acts as a passive shogi board; it
738      does not try to start a shogi program, not even to check whether
739      moves made in Force mode are legal.  It also sets -clockMode to
740      False.  Default: False.
741
742 `-fsp or -firstShogiProgram program'
743      Name of first shogi program.  In matches between two machines, this
744      program plays white.  Default: "gnushogi".
745
746 `-ssp or -secondShogiProgram program'
747      Name of second shogi program, if needed.  In matches between two
748      machines, this program plays black; otherwise it is not started.
749      Default: "gnushogi".
750
751 `-fh or -firstHost host'
752      Name of host the first shogi program plays on.  Default:
753      "localhost".
754
755 `-sh or -secondHost host'
756      Name of host the second shogi program plays on.  Default:
757      "localhost".
758
759 `-rsh or -remoteShell shell_name'
760      Some systems do not use rsh as the remote shell.  This option
761      allows a user to name the remote shell command.  This should be
762      done in the resource file.
763
764 `-mm or -matchMode (False | Init | Position | Opening)'
765      Automatically run a game between firstShogiProgram and
766      secondShogiProgram.  If matchMode is set to Init, xshogi will
767      start the game with the initial shogi position.  If matchMode is
768      set to Position, xshogi will start the game with the position
769      specified by the loadPositionFile resource.  If matchMode is set
770      to Opening, xshogi will play out the opening moves specified by
771      the -loadGameFile resource.  If the -saveGameFile resource is set,
772      a move record for the match will be saved in the specified file.
773      Default: "False".
774
775 `-lgf or -loadGameFile file'
776      Name of file to read a game record from.  Game files are found in
777      the directory named by the SHOGIDIR environment variable.  If this
778      variable is not set, the current directory is used unless the file
779      name starts with a /.
780
781 `-lpf or -loadPositionFile file'
782      Name of file to read a game position from.  Position files are
783      found in the directory named by the SHOGIDIR environment variable.
784      If this variable is not set, the current directory is used unless
785      the file name starts with a /.
786
787 `-sgf or -saveGameFile file'
788      Name of file to save a game record to.  Game files are saved in the
789      directory named by the SHOGIDIR environment variable.  If this
790      variable is not set, the current directory is used unless the file
791      name starts with a /.
792
793 `-spf or -savePositionFile file'
794      Name of file to save a game position to.  Position files are saved
795      in the directory named by the SHOGIDIR environment variable.  If
796      this variable is not set, the current directory is used unless the
797      file name starts with a /.
798
799 `-coords or -showCoords (True | False)'
800      If this option is True, xshogi displays algebraic coordinates
801      along the board's left and bottom edges.  The default is False.
802      The coordFont resource specifies what font to use.
803
804 `-mono or -monoMode (True | False)'
805      Determines whether xshogi displays its pieces and squares with two
806      colors or four.  You shouldn't have to specify monochrome.  xshogi
807      will determine if this is necessary.
808
809 `-pc or -pieceColor color'
810      Color specification for pieces suitable for XParseColor().
811      Default: #FFFFD7.
812
813 `-sc or -squareColor color'
814      Same for squares.  Default: #EBDFB0.
815
816 `-wps or -westernPieceSet (True | False)'
817      Choose the Western style piece set.
818
819 `-npb or -normalPawnBitmap file'
820
821 `-nnb or -normalKnightBitmap file'
822
823 `-nbb or -normalBishopBitmap file'
824
825 `-nrb or -normalRookBitmap file'
826
827 `-nkb or -normalKingBitmap file'
828      Names of the bitmap files for the bitmap piece icons.
829
830 `-rpb or -reversePawnBitmap file'
831
832 `-rnb or -reverseKnightBitmap file'
833
834 `-rbb or -reverseBishopBitmap file'
835
836 `-rrb or -reverseRookBitmap file'
837
838 `-rkb or -reverseKingBitmap file'
839      Names of the bitmap files for the outline piece icons.
840
841 `-debug or -debugMode (True | False)'
842      Turns on debugging printout.
843
844
845    OTHER X RESOURCES
846
847
848 `initString'
849      The actual string that is sent to initialize the shogi program can
850      be set from .Xdefaults.  It can't be set from the command line
851      because of syntax problems.  The default value is
852      "new\nbeep\nrandom\neasy\n".  The "new" and "beep" commands are
853      required. You can remove the "random" command if you like;
854      including it causes gnushogi to randomize its move selection
855      slightly so that it doesn't play the same moves in every game.
856      Even without "random", gnushogi randomizes its choice of moves
857      from its opening book.  You can also remove "easy" if you like;
858      including it toggles easy mode off, causing gnushogi to think on
859      your time.  That is, if "easy" is included in the initString, GNU
860      Shogi thinks on your time; if not, it does not.  (Yes, this does
861      seem backwards, doesn't it.)  You can also try adding other
862      commands to the initString; see the gnushogi documentation (*note
863      gnushogi::) for details.
864
865 `blackString and whiteString'
866      These resources control what is sent when the Machine Black and
867      Machine White buttons are selected.  This is mostly for
868      compatibility with obsolete versions of gnushogi.
869
870      Alternate bitmaps for piece icons can be specified either by
871      choosing one of the built-in sets or with the file name resources
872      described above.  There are three built-in sets of piece bitmaps
873      available, large (the default), medium, or small.  It is easiest
874      to select the set you prefer in the .Xdefaults file:
875
876      XShogi*boardSize:   Medium
877
878      The font used for button labels and comments can be changed in the
879      .Xdefaults file.  You may want to choose a smaller font if you are
880      using the small pieces:
881
882      XShogi*font:    helvetica_oblique12
883
884      The font used for coordinates (when the showCoords option is True)
885      can be set similarly:
886
887      XShogi*coordFont:    helvetica_10
888
889      If you are using a grayscale monitor, try setting the colors to:
890
891      XShogi*pieceColor:     gray100
892      XShogi*squareColor:    gray60
893
894    COMMAND BUTTONS AND KEYS
895
896
897 `Quit'
898      Quits xshogi.  Q or q is a keyboard equivalent.
899
900 `Reset'
901      Resets xshogi to the beginning of a shogi game.  It also deselects
902      any game or position files.
903
904 `Flip View'
905      inverts the view of the shogi board.
906
907 `Hint'
908      displays a move hint from gnushogi.
909
910 `Load Game'
911      plays a game from a record file.  If no file is specified a popup
912      dialog asks for a filename.  Game files are found in the directory
913      named by the SHOGIDIR environment variable.  If this variable is
914      not declared then the current directory is used unless the file
915      name starts with a /.  G or g is a keyboard equivalent.  The game
916      file parser will accept almost any file that contains moves in
917      algebraic notation.  If the first line begins with `#', it is
918      assumed to be a title and is displayed.  Text enclosed in
919      parentheses or square brackets is assumed to be commentary and is
920      displayed in a pop-up window.  Any other text in the file is
921      ignored.
922
923 `Load Position'
924      sets up a position from a position file.  If no file is specified a
925      popup dialog asks for a filename.  Position files are found in the
926      directory named by the SHOGIDIR environment variable.  If this
927      variable is not declared then the current directory is used unless
928      the file name starts with a /.  Position files must be in the
929      format that the Save Position command writes.
930
931 `Save Game'
932      saves a game to a record file.  If no file is specified a popup
933      dialog asks for a filename.  If the filename exists, the user is
934      asked whether the current game record is be appended to this file
935      or if the file should be replaced.  Game files are saved in the
936      directory named by the SHOGIDIR environment variable.  If this
937      variable is not declared then the current directory is used unless
938      the file name starts with a /.  Game files are human-readable, and
939      can also be read back by the Load Game command. Furthermore, they
940      are accepted as gnushogi text bookfiles.
941
942 `Save Position'
943      saves a position to a position file.  If no file is specified a
944      popup dialog asks for a filename.  Position files are saved in the
945      directory named by the SHOGIDIR environment variable.  If this
946      variable is not declared then the current directory is used unless
947      the file name starts with a /.  Position files are human-readable,
948      and can also be read back by the Load Position command.
949
950 `Machine White'
951      forces gnushogi to play white.
952
953 `Machine Black'
954      forces gnushogi to play black.
955
956 `Force Moves'
957      forces a series of moves.  That is, gnushogi stops playing and
958      xshogi allows you to make moves for both white and black.
959
960 `Two Machines'
961      plays a game between two computer programs.
962
963 `Forward'
964      moves forward through a series of remembered moves.  F or f is a
965      keyboard equivalent.
966
967 `Backward'
968      moves backward through a series of remembered moves.  As a side
969      effect, puts xshogi into Force Moves mode.  B or b is a keyboard
970      equivalent.
971
972 `Pause'
973      pauses the clocks or (in Load Game mode) pauses the game being
974      loaded.  Press Pause again to continue.  P or p is a keyboard
975      equivalent.
976
977 `Edit Position'
978      lets you set up an arbitrary board position.  Use mouse button 1
979      to drag pieces to new squares, or to delete a piece by dragging it
980      off the board or dragging an empty square on top of it.  To drop a
981      new piece on a square, press mouse button 2 or 3 over the square.
982      This brings up a menu of black pieces (button 2) or white pieces
983      (button 3).  Additional menu choices let you empty the square or
984      clear the board.  You can set the side to play next by clicking on
985      the Black or White indicator at the top of the screen.
986
987 `Challenge'
988      allows you to make a two display game between two human players.
989      Enter the display you want to connect to.  If you are allowed to
990      connect, a new board is displayed at the remote display.
991      Challenge mode can only be stopped by pressing "quit".
992
993 `Select Level'
994      allows you to reset the clocks for both players.  Enter the number
995      of moves and the number of minutes in which the moves should be
996      done.
997
998 `Move NOW'
999      force computer to stop thinking and to make the current best move.
1000
1001 `Iconify I, i, C or c'
1002      iconifies xshogi.
1003
1004
1005    LIMITATIONS
1006
1007
1008    If you press the  Pause  button  during  GNU  Shogi's  turn, xshogi
1009 will stop the clocks, but gnushogi will still make a move.
1010
1011    After a mate or draw when playing against gnushogi, if  you back  up
1012 with  the  Backward  button,  the clocks are reset (because gnushogi
1013 has exited and must be restarted).
1014
1015    The game parser recognizes only algebraic notation.
1016
1017
1018    AUTHORS
1019
1020
1021    Original authors of XBoard:  Chris Sears and Dan Sears.
1022
1023    Enhancements for XBoard (Version 2.0):  Tim Mann.
1024
1025    Conversion to XShogi (Version 1.1):  Matthias Mutz.
1026
1027    Current maintainer: Mike Vanier.
1028
1029
1030    COPYRIGHT INFORMATION
1031
1032
1033    XShogi borrows its piece bitmaps from CRANES Shogi.
1034
1035    Copyright 1991 by Digital Equipment Corporation, Maynard,
1036 Massachusetts.  Enhancements Copyright 1992 Free Software Foundation,
1037 Inc.  Enhancements Copyright 1993 Matthias Mutz.  Further enhancements
1038 copyright 1999 by Michael Vanier and the Free Software Foundation, Inc.
1039
1040    The following terms apply to Digital Equipment Corporation's
1041 copyright interest in XBoard:
1042
1043    All Rights Reserved
1044
1045    Permission to use, copy, modify, and distribute this software and its
1046 documentation for any purpose and without fee is hereby granted,
1047 provided that the above copyright notice appear in all copies and that
1048 both that copyright notice and this permission notice appear in
1049 supporting documentation, and that the name of Digital not be used in
1050 advertising or publicity pertaining to distribution of the software
1051 without specific, written prior permission.
1052
1053    DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
1054 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
1055 EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
1056 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
1057 USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1058 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1059 PERFORMANCE OF THIS SOFTWARE.
1060
1061    The following terms apply to the enhanced version of XShogi
1062 distributed by the Free Software Foundation:
1063
1064    This file is part of XSHOGI.
1065
1066    XSHOGI is distributed in the hope that it will be useful, but WITHOUT
1067 ANY WARRANTY.  No author or distributor accepts responsibility to anyone
1068 for the consequences of using it or for whether it serves any particular
1069 purpose or works at all, unless he says so in writing.  Refer to the
1070 XSHOGI General Public License for full details.
1071
1072    Everyone is granted permission to copy, modify and redistribute
1073 XSHOGI, but only under the conditions described in the XSHOGI General
1074 Public License. A copy of this license is supposed to have been given
1075 to you along with XSHOGI so you can know your rights and
1076 responsibilities.  It should be in a file named COPYING.  Among other
1077 things, the copyright notice and this notice must be preserved on all
1078 copies.
1079
1080 \1f
1081 File: gnushogi.info,  Node: References and links,  Next: Acknowledgements,  Prev: xshogi,  Up: Top
1082
1083 References and links
1084 ********************
1085
1086    There are very few English-language books for people learning shogi.
1087 The two I recommend are:
1088
1089
1090   1. `Shogi for Beginners, 2nd. Edition', by John Fairbairn.  This is a
1091      superb beginner's book in every way, covering all phases of the
1092      game.  It was out of print for a long time, but has now been
1093      reprinted and is available either from Kiseido
1094      (`http://www.labnet.or.jp/~kiseido') or from George Hodges (see
1095      below).
1096
1097   2. `The Art of Shogi', by Tony Hoskings.  This is one step up from the
1098      Fairbairn book.  It covers a lot of ground, and is especially
1099      noteworthy for its detailed treatment of opening lines.  You can
1100      order this book from Amazon.com's UK branch
1101      (`http://www.amazon.co.uk').
1102
1103
1104
1105    Another book you may find is `Shogi: Japan's Game of Strategy' by
1106 Trevor Leggett.  This book is very elementary and is somewhat outdated,
1107 having been published first in 1966.  However, it does feature a paper
1108 shogi board and punch-out pieces, so if you want a really cheap shogi
1109 set you might pick this book up.  It is still in print.
1110
1111    Two books that are no longer in print but are definitely worth
1112 getting if you find them are `Guide to Shogi Openings' and `Better
1113 Moves for Better Shogi', both by Aono Teriuchi.  They are published in a
1114 bilingual edition (English/Japanese) and are the only books on shogi in
1115 English written by a Japanese professional shogi player.  John Fairbairn
1116 did the translation from Japanese to English.
1117
1118    Shogi sets are available from:
1119
1120
1121      George F. Hodges
1122      P.O. Box 77
1123      Bromley, Kent
1124      United Kingdom BR1 2WT
1125
1126
1127    George also sells equipment for all the historical shogi variants
1128 (*note Shogi variants::) (except for Kyoku tai shogi) and also sells
1129 back issues of the magazine "Shogi" which he published for 70 issues in
1130 the late 70's to late 80's.  This magazine is STRONGLY recommended; it
1131 contains more information about shogi in English than you will ever
1132 find anywhere else.
1133
1134    Here are some useful URLs:
1135
1136
1137 Pieter Stouten's shogi page: `http://www.shogi.net'
1138      This is the main shogi-related site on the internet, with links to
1139      almost all the other sites.
1140
1141 Roger Hare's shogi page: `http://www.ed.ac.uk/~rjhare/shogi'
1142      This has lots of information, including full rules to most of the
1143      shogi variants.
1144
1145 Patrick Davin's Shogi Nexus: `http://www.vega.or.jp/~patrick/shogi/'
1146      There's lots of cool stuff on this site; my favorite is the
1147      extensive collection of Tsume-shogi (mating) problems, both for
1148      beginners and more advanced players.
1149
1150 Steve Evans' shogi page: `http://www.netspace.net.au/~trout/index.html'
1151      Steve has written a program that plays almost all of the shogi
1152      variants, unfortunately it only runs on Windows :-(
1153
1154 Hans Bodlaender's chess variant pages: `http://www.cs.ruu.nl/~hansb/d.chessvar'
1155      This page has an almost unimaginable variety of rules for different
1156      chess variants, including many shogi variants (historical and
1157      non-historical).
1158
1159
1160 \1f
1161 File: gnushogi.info,  Node: Acknowledgements,  Next: Bugs,  Prev: References and links,  Up: Top
1162
1163 Acknowledgements
1164 ****************
1165
1166    I would like to thank the following people:
1167
1168
1169    * Matthias Mutz, who originally developed GNU shogi as a spin-off of
1170      GNU chess and who very kindly let me take over the maintenance of
1171      this very interesting project.
1172
1173    * Richard Stallman and the Free Software Foundation, for creating an
1174      organization where anyone can contribute software for the common
1175      good of all, for making GNU/Linux possible, and especially for
1176      writing emacs and gcc, without which my working life would be
1177      intolerable.
1178
1179    * Georges Hodges, for starting the Shogi Association in England,
1180      without which I would probably never have heard of shogi, for
1181      supplying shogi equipment, for publishing the excellent magazine
1182      "Shogi" (now sadly defunct), for personally answering all my silly
1183      questions by mail, and for being the ambassador of shogi to the
1184      West.
1185
1186    * Pieter Stouten, for having the most comprehensive shogi site on the
1187      World Wide Web (`http://www.shogi.net'), and for maintaining the
1188      shogi-l mailing list.  Go to Pieter's web site for more
1189      information on subscribing to the list.  Also thanks to everyone
1190      who contributes and has contributed to that list.
1191
1192    * Matt Casters, for testing GNU shogi.  Matt and I will be working
1193      together on improving the solution engine in future versions of
1194      this program.
1195
1196
1197
1198 \1f
1199 File: gnushogi.info,  Node: Bugs,  Next: Index,  Prev: Acknowledgements,  Up: Top
1200
1201 Bugs
1202 ****
1203
1204    The motto of GNU shogi is "100% bug-free or you don't pay!" :-)  In
1205 the extremely unlikely case (*ahem*) that you do find a bug, please
1206 send me (Mike Vanier) an email at <mvanier@cs.caltech.edu>.  Also, feel
1207 free to send me comments, complaints, out-and-out raves, suggestions,
1208 plane tickets to Hawaii, and/or large suitcases filled with unmarked,
1209 untraceable hundred-dollar bills.
1210
1211 \1f
1212 File: gnushogi.info,  Node: Index,  Prev: Bugs,  Up: Top
1213
1214 Index
1215 *****
1216
1217 * Menu:
1218
1219 * Acknowledgements:                      Acknowledgements.
1220 * Books:                                 References and links.
1221 * Chu Shogi:                             Shogi variants.
1222 * Dai Shogi:                             Shogi variants.
1223 * Dai-dai Shogi:                         Shogi variants.
1224 * Draws:                                 Draws.
1225 * Drops:                                 Drops.
1226 * gnushogi:                              gnushogi.
1227 * GPL:                                   License.
1228 * Handicaps:                             Handicaps.
1229 * Introduction:                          Introduction.
1230 * Kyoku Tai Shogi:                       Shogi variants.
1231 * License:                               License.
1232 * Mailing lists:                         References and links.
1233 * Maka-dai-dai Shogi:                    Shogi variants.
1234 * Opening setup:                         The opening setup.
1235 * Piece moves:                           The moves of the pieces.
1236 * Piece promotion:                       Promotion of pieces.
1237 * References:                            References and links.
1238 * Rules:                                 The rules of shogi.
1239 * Sample game:                           Sample game.
1240 * Shogi variants:                        Shogi variants.
1241 * Shogi vs. Chess:                       Differences between shogi and chess.
1242 * Tai Shogi:                             Shogi variants.
1243 * Tenjiku Shogi:                         Shogi variants.
1244 * Tori Shogi:                            Shogi variants.
1245 * Variants:                              Shogi variants.
1246 * Wa Shogi:                              Shogi variants.
1247 * Web sites:                             References and links.
1248 * Winning the game:                      Winning the game.
1249 * xshogi:                                xshogi.
1250
1251