2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3 <!-- Created on July, 7 2004 by texi2html 1.64 -->
5 Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
6 Karl Berry <karl@freefriends.org>
7 Olaf Bachmann <obachman@mathematik.uni-kl.de>
9 Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
10 Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
14 <TITLE>GNU Shogi manual: gnushogi</TITLE>
16 <META NAME="description" CONTENT="GNU Shogi manual: gnushogi">
17 <META NAME="keywords" CONTENT="GNU Shogi manual: gnushogi">
18 <META NAME="resource-type" CONTENT="document">
19 <META NAME="distribution" CONTENT="global">
20 <META NAME="Generator" CONTENT="texi2html 1.64">
24 <BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
27 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
28 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi_18.html#SEC18"> < </A>]</TD>
29 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi_20.html#SEC20"> > </A>]</TD>
30 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi_5.html#SEC5"> << </A>]</TD>
31 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi.html#SEC_Top"> Up </A>]</TD>
32 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi_20.html#SEC20"> >> </A>]</TD>
33 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi.html#SEC_Top">Top</A>]</TD>
34 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi_toc.html#SEC_Contents">Contents</A>]</TD>
35 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi_24.html#SEC24">Index</A>]</TD>
36 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi_abt.html#SEC_About"> ? </A>]</TD>
39 <H1> 3. gnushogi </H1>
43 This section describes how to run the "gnushogi" program.
50 gnushogi [ [[-]a] [-b bookfile] [-B binbookfile] [-C] [-h langfile]
51 [-L langfile] [-r length] [-R] [-s pathname] [-l pathname] [-S binbooksize]
52 [-t] [-c size] [-T size] [-v] [-x] [-X] arg1 arg2 ]
58 GNU shogi (gnushogi) plays a game of japanese chess (shogi) against the
59 user or it plays against itself.
62 At startup gnushogi reads the binbook file if it is present. It then
63 looks for a book file. If it is present it adds its contents to the
64 binbook data. If the binbook file is writable a new combined binbook
68 Gnushogi is a modified version of the gnuchess program. It has a simple
69 alphanumeric board display, or it can be used with the xshogi program
70 under X windows. The program gets its opening moves from the file
71 gnushogi.bbk which is located in a directory specified in the Makefile.
72 To invoke the program type:
77 <DT><SAMP>`gnushogi -C'</SAMP>
78 <DD>simple curses based version
81 <DT><SAMP>`gnushogi -X (or just gnushogi)'</SAMP>
82 <DD>xshogi compatible version
85 <DT><SAMP>`gnushogi -R'</SAMP>
86 <DD>raw test display version
93 If one argument is given, it is the search time per move in
94 [minutes:]seconds. So gnushogi 30 will generate one move every 30
95 seconds, while gnushogi 5:00 will generate one move every 5 minutes.
98 If two or more arguments are given, they will be used to set tournament
99 time controls with the first argument of each pair being the number of
100 moves and the second being the total clock time in minutes[:seconds].
101 Thus, entering gnushogi 60 5 will set the clocks for 5 minutes (300
102 seconds) for the first 60 moves, and gnushogi 30 3:30 will allow 3
103 minutes and 30 seconds for 30 moves.
106 gnushogi 30 5 1 :30 will allow 5 minutes for the first 30 moves and 30
107 seconds for each move after that. Up to 4 pairs of controls may be
111 If no argument is given the program will prompt the user for level of
115 For use with xshogi see the documentation on that program.
116 See section <A HREF="gnushogi_20.html#SEC20">4. xshogi</A>.
122 The book gnushogi.tbk consists of a sequence of openings. An opening
123 begins with a line starting with a # (the rest of the line is a comment).
124 Following this is a series of moves in algebraic notation alternating
125 between black and white separated by whitespace. A move may have a ?
126 after it indicating this move should never be made in this position. Moves
127 are stored as position:move so transpositions between openings can take
134 The hashfile if created should be on the order of 4 megabytes; you can
135 create such a hashfile by typing "gnushogi -c 22" (see below). This
136 file contains positions and moves learned from previous games. If a
137 hashfile is used the computer makes use of the experience it gained in
138 past games. Tests run so far show that it plays no worse with the
139 hashfile than without, but it is not clear yet whether it provides a
146 Note: Piece letters are determined by the language file. What is
147 specified here is the default (English).
150 Once gnushogi is invoked, the program will display the board and prompt
151 the user for a move. To enter a move, use the notation 7g7f where the
152 first letter-number pair indicates the origin square and the second
153 letter-number pair indicates the destination square. An alternative is
154 to use the notation P7f where the first letter indicates the piece type
155 (P,L,N,S,G,B,R,K). To promote append a + the type of the new piece to
156 the move, as in 2d2c+ or P2c+. Note that you must use capital letters
157 for the pieces by default.
165 <DT><SAMP>`-a'</SAMP>
166 <DD>Do not search on opponent's time.
170 <DD>Do search on opponent's time.
173 <DT><SAMP>`-b <VAR>bookfile</VAR>'</SAMP>
174 <DD>Use bookfile for opening book.
177 <DT><SAMP>`-B <VAR>binbookfile</VAR>'</SAMP>
178 <DD>Use binbookfile for binary opening book.
181 <DT><SAMP>`-c <VAR>size</VAR>'</SAMP>
182 <DD>Create a new HASHFILE. File size is 2^size entries of approximately 65+?
186 <DT><SAMP>`-C'</SAMP>
187 <DD>Use curses-based display mode.
190 <DT><SAMP>`-h'</SAMP>
191 <DD>Do not use hashfile.
198 <DT><SAMP>`-l <VAR>pathname</VAR>'</SAMP>
199 <DD>Pathname of the loadfile used with get or xget.
202 <DT><SAMP>`-L <VAR>lang</VAR>'</SAMP>
203 <DD>Use language lang from the file gnushogi.lang. If -L is not specified
204 it uses the first language in the file.
207 <DT><SAMP>`-P <VAR>plylevels</VAR>'</SAMP>
208 <DD>Number of plys to include in the binbookfile. For generating a
212 <DT><SAMP>`-r <VAR>length</VAR>'</SAMP>
213 <DD>Rehash <EM>length</EM> times in searching entries for position in
217 <DT><SAMP>`-R'</SAMP>
218 <DD>Use raw text display mode. This can be used for dumb terminals or for
219 systems that don't have curses.
222 <DT><SAMP>`-s <VAR>pathname</VAR>'</SAMP>
223 <DD>Pathname of the save file to use with the save command.
226 <DT><SAMP>`-S <VAR>size</VAR>'</SAMP>
227 <DD>Size of binbookfile for memory based books. For creating a binbookfile.
230 <DT><SAMP>`-t'</SAMP>
231 <DD>Show statistics for HASHFILE.
234 <DT><SAMP>`-T <VAR>size</VAR>'</SAMP>
235 <DD>Set the transposition table size to 2^size entries.
238 <DT><SAMP>`-v'</SAMP>
239 <DD>Show version and patchlevel.
242 <DT><SAMP>`-x <VAR>value</VAR>'</SAMP>
243 <DD>Use value as the evaluation window xwndw.
246 <DT><SAMP>`-X'</SAMP>
247 <DD>Use xshogi display mode (the default).
256 In addition to legal moves, the following commands can be entered at the
257 gnushogi prompt. Note: command names are determined by the language
258 file and may vary with the implementation. The default language is
264 <DT><SAMP>`alg'</SAMP>
265 <DD>allow algebraic input (not implemented).
268 <DT><SAMP>`Awindow'</SAMP>
269 <DD>change Alpha window (default score + 90).
272 <DT><SAMP>`Bwindow'</SAMP>
273 <DD>change Beta window (default score - 90).
276 <DT><SAMP>`beep'</SAMP>
277 <DD>toggles beeping after each move (default: on).
280 <DT><SAMP>`bd'</SAMP>
281 <DD>updates the current board position on the display.
284 <DT><SAMP>`book'</SAMP>
285 <DD>turns off use of the opening library.
288 <DT><SAMP>`both'</SAMP>
289 <DD>causes the computer to play both sides of a shogi game.
292 <DT><SAMP>`black'</SAMP>
293 <DD>causes the computer to play as White, if the computer was to move
297 <DT><SAMP>`bsave'</SAMP>
298 <DD>saves a game to disk as a book textfile. The program will prompt the
299 user for a file name.
302 <DT><SAMP>`gamein'</SAMP>
303 <DD>toggles game mode time control. Assumes the time specified for time
304 control is the time for a complete game. Input with the level command
305 should be the game time and the expected number of moves in a game. go
306 command must be given.
309 <DT><SAMP>`coords'</SAMP>
310 <DD>show coordinates on the display (visual only).
313 <DT><SAMP>`contempt'</SAMP>
314 <DD>allows the value of <EM>contempt</EM> to be modified.
317 <DT><SAMP>`debug'</SAMP>
318 <DD>asks for a piece as color piece, as wb or bn, and shows its calculated
319 value on each square.
322 <DT><SAMP>`debuglevel'</SAMP>
323 <DD>sets level of debugging output if compiled with debug options.
326 <DT><SAMP>`depth'</SAMP>
327 <DD>allows the user to change the search depth of the program. The maximum
328 depth is 29 ply. Normally the depth is set to 29 and the computer
329 terminates its search based on elapsed time rather than depth. If depth
330 is set to (say) 4 ply, the program will search until all moves have been
331 examined to a depth of 4 ply (with extensions up to 11 additional ply
332 for sequences of checks and captures). If you set a maximum time per
333 move and also use the depth command, the search will stop at the
334 specified time or the specified depth, whichever comes first.
337 <DT><SAMP>`easy'</SAMP>
338 <DD>toggles easy mode (thinking on opponents time) on and off. The default
339 is easy mode ON. If easy mode is disabled, the keyboard is polled for
340 input every so often and when input is seen the search is terminated. It
341 may also be terminated with a sigint.
344 <DT><SAMP>`edit'</SAMP>
345 <DD>allows the user to set up a board position.
357 command will exit setup mode.
365 place a promoted pawn on 3b
369 place a pawn in hand (among the captured pieces)
375 Pieces are entered by typing a letter (p,l,n,s,g,b,r,k) for
376 the piece followed by the coordinate. Here, letter case is ignored.
379 The usual warning about the language file applies.
382 <DT><SAMP>`exit'</SAMP>
386 <DT><SAMP>`first'</SAMP>
387 <DD>tells the computer to move first. Computer begins searching for a move.
391 <DT><SAMP>`force'</SAMP>
392 <DD>allows the user to enter moves for both sides. To get the program to
393 play after a sequence of moves has been entered use the "black" or
397 <DT><SAMP>`get'</SAMP>
398 <DD>retrieves a game from disk. The program will prompt the user for a file
402 <DT><SAMP>`go'</SAMP>
403 <DD>tells the computer to move first. Computer begins searching for a move.
407 <DT><SAMP>`hash'</SAMP>
408 <DD>use/don't use hashfile.
411 <DT><SAMP>`hashdepth'</SAMP>
412 <DD>allows the user to change the minimum depth for using the hashfile and
413 the number of moves from the beginning of the game to use it.
416 <DT><SAMP>`help'</SAMP>
417 <DD>displays a short description of the commands and the current status of
421 <DT><SAMP>`hint'</SAMP>
422 <DD>causes the program to supply the user with its predicted move.
425 <DT><SAMP>`level'</SAMP>
426 <DD>allows the user to set time controls such as 60 moves in 5 minutes etc.
427 In tournament mode, the program will vary the time it takes for each
428 move depending on the situation. If easy mode is disabled (using the
429 "easy" command), the program will often respond with its move
430 immediately, saving time on its clock for use later on.
433 <DT><SAMP>`list'</SAMP>
434 <DD>writes the game moves and some statistics on search depth, nodes, and
435 time to the file "shogi.lst".
438 <DT><SAMP>`material'</SAMP>
439 <DD>toggle material flag - draws on no pawns and both sides < rook.
442 <DT><SAMP>`new'</SAMP>
443 <DD>starts a new game.
447 <DD>evaluates the board and shows the point score for each piece. The total
448 score for a position is the sum of these individual piece scores.
451 <DT><SAMP>`post'</SAMP>
452 <DD>causes the program to display the principal variation and the score
453 during the search. A score of 100 is equivalent to a 1 pawn advantage
457 <DT><SAMP>`quit'</SAMP>
461 <DT><SAMP>`random'</SAMP>
462 <DD>causes the program to randomize its move selection slightly.
465 <DT><SAMP>`rcptr'</SAMP>
466 <DD>set recapture mode.
469 <DT><SAMP>`remove'</SAMP>
470 <DD>backout the last level for both sides. Equal to 2 undo's.
473 <DT><SAMP>`reverse'</SAMP>
474 <DD>causes the board display to be reversed. That is, the Black's pieces will
475 now appear at the top of the board.
478 <DT><SAMP>`rv'</SAMP>
479 <DD>reverse board display.
482 <DT><SAMP>`save'</SAMP>
483 <DD>saves a game to disk. The program will prompt the user for a file name.
486 <DT><SAMP>`switch'</SAMP>
487 <DD>causes the program to switch places with the opponent and begin
491 <DT><SAMP>`test'</SAMP>
492 <DD>performs some speed tests for MoveList and CaptureList generation, and
493 ScorePosition position scoring for the current board.
496 <DT><SAMP>`time'</SAMP>
497 <DD>set computer's time remaining, intended for synchronizing clocks among
501 <DT><SAMP>`tsume'</SAMP>
502 <DD>toggle tsume mode. In tsume mode, not all possible moves will be
503 generated. If a king is in check, only moves that get the king out of
504 check are generated. If the king is not in check, only moves that give
505 check to the opponent's king are generated.
508 <DT><SAMP>`undo'</SAMP>
509 <DD>undoes the last move whether it was the computer's or the human's. You
510 may also type "remove". This is equivalent to two "undo"'s
511 (e.g. retract one move for each side).
514 <DT><SAMP>`white'</SAMP>
515 <DD>causes the computer to play as Black; if the computer is to move
516 first the go command must be given.
519 <DT><SAMP>`xget'</SAMP>
520 <DD>read an xshogi position file.
523 <DT><SAMP>`xsave'</SAMP>
524 <DD>save as an xshogi position file.
527 <DT><SAMP>`xwndw'</SAMP>
528 <DD>change X window. The window around alpha/beta used to determine whether
529 the position should be scored or just estimated. Note: this has
530 <EM>nothing</EM> to do with xshogi or X windows; the terms are completely
537 <A NAME="xshogi"></A>
539 <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
540 <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi_18.html#SEC18"> < </A>]</TD>
541 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi_20.html#SEC20"> > </A>]</TD>
542 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi_5.html#SEC5"> << </A>]</TD>
543 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi.html#SEC_Top"> Up </A>]</TD>
544 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi_20.html#SEC20"> >> </A>]</TD>
545 <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi.html#SEC_Top">Top</A>]</TD>
546 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi_toc.html#SEC_Contents">Contents</A>]</TD>
547 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi_24.html#SEC24">Index</A>]</TD>
548 <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gnushogi_abt.html#SEC_About"> ? </A>]</TD>
552 This document was generated
553 by <I>Michael C. Vanier</I> on <I>July, 7 2004</I>
554 using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
555 "><I>texi2html</I></A>