3 <!-- Created by texi2html 1.57 from gnushogi.texinfo on June 29, 1999 -->
5 <TITLE>GNU Shogi manual - gnushogi</TITLE>
8 [<A HREF="gnushogi_toc.html">Contents</A>]   [<A HREF="gnushogi_16.html">Back</A>]   [<A HREF="gnushogi_3.html">Prev</A>]   [<A>Up</A>]   [<A HREF="gnushogi_18.html">Next</A>]   [<A HREF="gnushogi_18.html">Forward</A>]  <BR><HR><BR>
11 <H1><A NAME="SEC20">gnushogi</A></H1>
17 This section describes how to run the "gnushogi" program.
26 gnushogi [ [[-]a] [-b bookfile] [-B binbookfile] [-C] [-h langfile]
27 [-L langfile] [-r length] [-R] [-s pathname] [-l pathname] [-S binbooksize]
28 [-t] [-c size] [-T size] [-v] [-x] [-X] arg1 arg2 ]
36 GNU shogi (gnushogi) plays a game of japanese chess (shogi) against the
37 user or it plays against itself.
41 At startup gnushogi reads the binbook file if it is present. It then
42 looks for a book file. If it is present it adds its contents to the
43 binbook data. If the binbook file is writable a new combined binbook
48 Gnushogi is a modified version of the gnuchess program. It has a simple
49 alphanumeric board display, or it can be used with the xshogi program
50 under X windows. The program gets its opening moves from the file
51 gnushogi.bbk which is located in a directory specified in the Makefile.
52 To invoke the program type:
57 <DT><SAMP>`gnushogi -C'</SAMP>
59 simple curses based version
61 <DT><SAMP>`gnushogi -X (or just gnushogi)'</SAMP>
63 xshogi compatible version
65 <DT><SAMP>`gnushogi -R'</SAMP>
67 raw test display version
75 If one argument is given, it is the search time per move in
76 [minutes:]seconds. So gnushogi 30 will generate one move every 30
77 seconds, while gnushogi 5:00 will generate one move every 5 minutes.
81 If two or more arguments are given, they will be used to set tournament
82 time controls with the first argument of each pair being the number of
83 moves and the second being the total clock time in minutes[:seconds].
84 Thus, entering gnushogi 60 5 will set the clocks for 5 minutes (300
85 seconds) for the first 60 moves, and gnushogi 30 3:30 will allow 3
86 minutes and 30 seconds for 30 moves.
90 gnushogi 30 5 1 :30 will allow 5 minutes for the first 30 moves and 30
91 seconds for each move after that. Up to 4 pairs of controls may be
96 If no argument is given the program will prompt the user for level of
101 For use with xshogi see the documentation on that program.
102 See section <A HREF="gnushogi_18.html#SEC21">xshogi</A>.
110 The book gnushogi.tbk consists of a sequence of openings. An opening
111 begins with a line starting with a # (the rest of the line is a
112 comment). Following this is a series of moves in algebraic notation
113 alternating black and white separated by white space. A move may have a
114 ? after it indicating this move should never be made in this position.
115 Moves are stored as position:move so transpositions between openings can
124 The hashfile if created should be on the order of 4 megabytes; you can
125 create such a hashfile by typing "gnushogi -c 22" (see below). This
126 file contains positions and moves learned from previous games. If a
127 hashfile is used the computer makes use of the experience it gained in
128 past games. Tests run so far show that it plays no worse with the
129 hashfile than without, but it is not clear yet whether it provides a
138 Note: Piece letters are determined by the language file. What is
139 specified here is the default (English).
143 Once gnushogi is invoked, the program will display the board and prompt
144 the user for a move. To enter a move, use the notation 7g7f where the
145 first letter-number pair indicates the origin square and the second
146 letter-number pair indicates the destination square. An alternative is
147 to use the notation P7f where the first letter indicates the piece type
148 (P,L,N,S,G,B,R,K). To promote append a + the type of the new piece to
149 the move, as in 2d2c+ or P2c+. Note that you must use capital letters
150 for the pieces by default.
159 <DT><SAMP>`-a'</SAMP>
161 Do not search on opponent's time.
165 Do search on opponent's time.
167 <DT><SAMP>`-b <VAR>bookfile</VAR>'</SAMP>
169 Use bookfile for opening book.
171 <DT><SAMP>`-B <VAR>binbookfile</VAR>'</SAMP>
173 Use binbookfile for binary opening book.
175 <DT><SAMP>`-c <VAR>size</VAR>'</SAMP>
177 Create a new HASHFILE. File size is 2^size entries of approximately 65+?
180 <DT><SAMP>`-C'</SAMP>
182 Use curses-based display mode.
184 <DT><SAMP>`-h'</SAMP>
192 <DT><SAMP>`-l <VAR>pathname</VAR>'</SAMP>
194 Pathname of the loadfile used with get or xget.
196 <DT><SAMP>`-L <VAR>lang</VAR>'</SAMP>
198 Use language lang from the file gnushogi.lang. If -L is not specified
199 it uses the first language in the file.
201 <DT><SAMP>`-P <VAR>plylevels</VAR>'</SAMP>
203 Number of plys to include in the binbookfile. For generating a
206 <DT><SAMP>`-r <VAR>length</VAR>'</SAMP>
208 Rehash <EM>length</EM> times in searching entries for position in
211 <DT><SAMP>`-R'</SAMP>
213 Use raw text display mode. This can be used for dumb terminals or for
214 systems that don't have curses.
216 <DT><SAMP>`-s <VAR>pathname</VAR>'</SAMP>
218 Pathname of the save file to use with the save command.
220 <DT><SAMP>`-S <VAR>size</VAR>'</SAMP>
222 Size of binbookfile for memory based books. For creating a binbookfile.
224 <DT><SAMP>`-t'</SAMP>
226 Show statistics for HASHFILE.
228 <DT><SAMP>`-T <VAR>size</VAR>'</SAMP>
230 Set the transposition table size to 2^size entries.
232 <DT><SAMP>`-v'</SAMP>
234 Show version and patchlevel.
236 <DT><SAMP>`-x <VAR>value</VAR>'</SAMP>
238 Use value as the evaluation window xwndw.
240 <DT><SAMP>`-X'</SAMP>
242 Use xshogi display mode (the default).
251 In addition to legal moves, the following commands can be entered at the
252 gnushogi prompt. Note: command names are determined by the language
253 file and may vary with the implementation. The default language is
259 <DT><SAMP>`alg'</SAMP>
261 allow algebraic input (not implemented).
263 <DT><SAMP>`Awindow'</SAMP>
265 change Alpha window (default score + 90).
267 <DT><SAMP>`Bwindow'</SAMP>
269 change Beta window (default score - 90).
271 <DT><SAMP>`beep'</SAMP>
273 toggles beeping after each move (default: on).
275 <DT><SAMP>`bd'</SAMP>
277 updates the current board position on the display.
279 <DT><SAMP>`book'</SAMP>
281 turns off use of the opening library.
283 <DT><SAMP>`both'</SAMP>
285 causes the computer to play both sides of a shogi game.
287 <DT><SAMP>`black'</SAMP>
289 causes the computer to take the white pieces, if the computer is to move
292 <DT><SAMP>`bsave'</SAMP>
294 saves a game to disk as a book textfile. The program will prompt the
295 user for a file name.
297 <DT><SAMP>`gamein'</SAMP>
299 toggles game mode time control. Assumes the time specified for time
300 control is the time for a complete game. Input with the level command
301 should be the game time and the expected number of moves in a game. go
302 command must be given.
304 <DT><SAMP>`coords'</SAMP>
306 show coordinates on the display (visual only).
308 <DT><SAMP>`contempt'</SAMP>
310 allows the value of <EM>contempt</EM> to be modified.
312 <DT><SAMP>`debug'</SAMP>
314 asks for a piece as color piece, as wb or bn, and shows its calculated
315 value on each square.
317 <DT><SAMP>`debuglevel'</SAMP>
319 sets level of debugging output if compiled with debug options.
321 <DT><SAMP>`depth'</SAMP>
323 allows the user to change the search depth of the program. The maximum
324 depth is 29 ply. Normally the depth is set to 29 and the computer
325 terminates its search based on elapsed time rather than depth. If depth
326 is set to (say) 4 ply, the program will search until all moves have been
327 examined to a depth of 4 ply (with extensions up to 11 additional ply
328 for sequences of checks and captures). If you set a maximum time per
329 move and also use the depth command, the search will stop at the
330 specified time or the specified depth, whichever comes first.
332 <DT><SAMP>`easy'</SAMP>
334 toggles easy mode (thinking on opponents time) on and off. The default
335 is easy mode ON. If easy mode is disabled, the keyboard is polled for
336 input every so often and when input is seen the search is terminated. It
337 may also be terminated with a sigint.
339 <DT><SAMP>`edit'</SAMP>
341 allows the user to set up a board position.
355 command will exit setup mode.
363 place a promoted pawn on 3b
367 place a pawn in hand (among the captured pieces)
371 Pieces are entered by typing a letter (p,l,n,s,g,b,r,k) for
372 the piece followed by the coordinate. Here, letter case is ignored.
374 The usual warning about the language file applies.
376 <DT><SAMP>`exit'</SAMP>
380 <DT><SAMP>`first'</SAMP>
382 tells the computer to move first. Computer begins searching for a move.
385 <DT><SAMP>`force'</SAMP>
387 allows the user to enter moves for both sides. To get the program to
388 play after a sequence of moves has been entered use the "black" or
391 <DT><SAMP>`get'</SAMP>
393 retrieves a game from disk. The program will prompt the user for a file
396 <DT><SAMP>`go'</SAMP>
398 tells the computer to move first. Computer begins searching for a move.
401 <DT><SAMP>`hash'</SAMP>
403 use/don't use hashfile.
405 <DT><SAMP>`hashdepth'</SAMP>
407 allows the user to change the minimum depth for using the hashfile and
408 the number of moves from the beginning of the game to use it.
410 <DT><SAMP>`help'</SAMP>
412 displays a short description of the commands and the current status of
415 <DT><SAMP>`hint'</SAMP>
417 causes the program to supply the user with its predicted move.
419 <DT><SAMP>`level'</SAMP>
421 allows the user to set time controls such as 60 moves in 5 minutes etc.
422 In tournament mode, the program will vary the time it takes for each
423 move depending on the situation. If easy mode is disabled (using the
424 "easy" command), the program will often respond with its move
425 immediately, saving time on its clock for use later on.
427 <DT><SAMP>`list'</SAMP>
429 writes the game moves and some statistics on search depth, nodes, and
430 time to the file "shogi.lst".
432 <DT><SAMP>`material'</SAMP>
434 toggle material flag - draws on no pawns and both sides < rook.
436 <DT><SAMP>`new'</SAMP>
442 evaluates the board and shows the point score for each piece. The total
443 score for a position is the sum of these individual piece scores.
445 <DT><SAMP>`post'</SAMP>
447 causes the program to display the principal variation and the score
448 during the search. A score of 100 is equivalent to a 1 pawn advantage
451 <DT><SAMP>`quit'</SAMP>
455 <DT><SAMP>`random'</SAMP>
457 causes the program to randomize its move selection slightly.
459 <DT><SAMP>`rcptr'</SAMP>
463 <DT><SAMP>`remove'</SAMP>
465 backout the last level for both sides. Equal to 2 undo's.
467 <DT><SAMP>`reverse'</SAMP>
469 causes the board display to be reversed. That is, the black pieces will
470 now appear at the top of the board.
472 <DT><SAMP>`rv'</SAMP>
474 reverse board display.
476 <DT><SAMP>`save'</SAMP>
478 saves a game to disk. The program will prompt the user for a file name.
480 <DT><SAMP>`switch'</SAMP>
482 causes the program to switch places with the opponent and begin
485 <DT><SAMP>`test'</SAMP>
487 performs some speed tests for MoveList and CaptureList generation, and
488 ScorePosition position scoring for the current board.
490 <DT><SAMP>`time'</SAMP>
492 set computer's time remaining, intended for synchronizing clocks among
495 <DT><SAMP>`tsume'</SAMP>
497 toggle tsume mode. In tsume mode, not all possible moves will be
498 generated. If a king is in check, only moves that get the king out of
499 check are generated. If the king is not in check, only moves that give
500 check to the opponent's king are generated.
502 <DT><SAMP>`undo'</SAMP>
504 undoes the last move whether it was the computer's or the human's. You
505 may also type "remove". This is equivalent to two "undo"'s
506 (e.g. retract one move for each side).
508 <DT><SAMP>`white'</SAMP>
510 causes the computer to take the black pieces, if the computer is to move
511 first the go command must be given.
513 <DT><SAMP>`xget'</SAMP>
515 read an xshogi position file.
517 <DT><SAMP>`xsave'</SAMP>
519 save as an xshogi position file.
521 <DT><SAMP>`xwndw'</SAMP>
523 change X window. The window around alpha/beta used to determine whether
524 the position should be scored or just estimated. Note: this has
525 <EM>nothing</EM> to do with xshogi or X windows; the terms are completely
531 [<A HREF="gnushogi_toc.html">Contents</A>]   [<A HREF="gnushogi_16.html">Back</A>]   [<A HREF="gnushogi_3.html">Prev</A>]   [<A>Up</A>]   [<A HREF="gnushogi_18.html">Next</A>]   [<A HREF="gnushogi_18.html">Forward</A>]