XBoard: split printing of the features line for clarity.
[gnushogi.git] / doc / gnushogi.6
1 .TH gnushogi 6
2 .SH NAME
3 gnushogi \- GNU Shogi (Japanese Chess)
4 .SH SYNOPSIS
5 .B gnushogi
6 [
7 .B [[-]a] 
8 .B [-b bookfile] 
9 .B [-B binbookfile] 
10 .B [-C] 
11 .B [-h langfile] 
12 .B [-L langfile] 
13 .B [-r length]
14 .B [-R]
15 .B [-s pathname] [-l pathname] 
16 .B [-S binbooksize]
17 .B [-t] [-c size] 
18 .B [-T size]
19 .B [-v]
20 .B [-x]
21 .B [-X]
22 .B arg1 arg2
23 ]
24 .SH DESCRIPTION
25 .I Gnushogi
26 plays a game of japanese chess (shogi) against the user or it plays against
27 itself.
28 .PP
29 At startup 
30 .I Gnushogi
31 reads the
32 .I binbook
33 file if it is present. It then looks for a 
34 .I book
35 file. If it is present it adds its contents to the 
36 .I binbook
37 data. If the 
38 .I binbook
39 file is writable a new combined
40 .I binbook
41 file is written.
42
43 .PP
44 .I Gnushogi
45 is a modified version of the gnuchess program.  It has a simple
46 alphanumeric board display, or it can be compiled for use with the
47 .B xshogi 
48 program under X windows.  The program gets its opening moves from the file
49 .B gnushogi.bbk 
50 which is located in a directory specified in the Makefile.  To invoke the
51 program type:
52 .TP
53 .B gnushogi -C
54 - simple curses based version
55 .TP
56 .B gnushogi -X (or just gnushogi)
57 - xshogi compatible version
58 .TP
59 .B gnushogi -R
60 - raw test display version
61 .SH TIME CONTROLS
62 .PP
63 If one argument is given, it is the search time per move in 
64 [minutes:]seconds.
65 So 
66 .B gnushogi 30
67 will generate one move every 30 seconds, while
68 .B gnushogi 5:00
69 will generate one move every 5 minutes.
70
71 If two or more arguments are given, they will be used to set tournament
72 time controls with the first argument of each pair being the number of
73 moves and the second being the total clock time in minutes[:seconds].
74 Thus, entering
75 .B gnushogi 60 5
76 will set
77 the clocks for 5 minutes (300 seconds) for the first 60 moves,
78 and 
79 .B gnushogi 30 3:30
80 will allow 3 minutes and 30 seconds for 30 moves.
81
82 .B gnushogi 30 5 1 :30
83 will allow 5 minutes for the first 30 moves and 30 seconds for each move
84 after that.  Up to 4 pairs of controls may be specified.
85
86 If no argument is given the program will prompt the user for level of play.
87
88 For use with 
89 .B xshogi
90 see the documentation on that program.
91 .SH BOOK
92 .PP
93 The book
94 .I gnushogi.tbk
95 consists of a sequence of openings.  An opening begins with a line starting
96 with a
97 .B #
98 , the rest of the line is a comment.  Following this is a series of moves
99 in algebraic notation alternating black and white separated by white
100 space. A move may have a
101 .B ?
102 after it indicating this move should never be made in this position.
103 Moves are stored as position:move so transpositions between openings
104 can take place. 
105 .SH HASHFILE
106 .PP
107 The hashfile if created should be on the order of 4 megabytes or
108 .B gnushogi -c 22.
109 This file contains positions and moves learned from previous games.  If a
110 hashfile is used the computer makes use of the experience it gained in past
111 games. Tests run so far show that it plays no worse with the hashfile than
112 without, but it is not clear yet whether it provides a real advantage.
113 .SH LEGAL MOVES
114 .PP
115 .B Note:
116 Piece letters are determined by the language file.
117 What is specified here is the default (English).
118 .PP
119 Once
120 .I gnushogi
121 is invoked, the program will display the board and prompt the user
122 for a move. To enter a move, use the notation 
123 .B 7g7f
124 where the first letter-number pair indicates the origin square
125 and the second letter-number pair indicates the destination square.
126 An alternative is to use the notation 
127 .B P7f
128 where the first letter indicates the piece type (P,L,N,S,G,B,R,K).
129 To promote append a + the type of the new piece to the move, as in 
130 .B 2d2c+ 
131 or 
132 .B P2c+.
133 Note that you must use capital letters for the pieces by default.
134 .SH "COMMAND-LINE OPTIONS"
135 .TP
136 .B -a
137 Do not search on opponent's time.
138 .TP
139 .B a
140 Do search on opponent's time.
141 .TP
142 .B -b bookfile
143 Use bookfile for opening book.
144 .TP
145 .B -B binbookfile
146 Use binbookfile for binary opening book.
147 .TP
148 .B -c size
149 Create a new HASHFILE. File size is 2^size entries of approximately 65+? bytes.
150 .TP
151 .B -C
152 Use curses-based display mode.
153 .TP
154 .B -h 
155 Do not use hashfile.
156 .TP
157 .B h 
158 Do use hashfile.
159 .TP
160 .B -l pathname
161 Pathname of the loadfile use with
162 .BR get
163 or
164 .BR xget.
165 .TP
166 .B -L lang
167 Use language 
168 .I lang from the file 
169 .B gnushogi.lang.
170 If -L is not specified it uses the first language in the file.
171 .TP
172 .B -P plylevels
173 Number of plys to include in the binbookfile. For generating a binbookfile.
174 .TP
175 .B -r length
176 Rehash length times in searching  entries for position in transposition table.
177 .TP
178 .B -R
179 Use raw text display mode.  This can be used for dumb terminals or for
180 systems that don't have curses.
181 .TP
182 .B -s pathname
183 Pathname of the save file to use with the
184 .BR save
185 command.
186 .TP
187 .B -S size
188 Size of binbookfile for memory based books. For creating a binbookfile.
189 .TP
190 .B -t
191 Show statistics for HASHFILE
192 .TP
193 .B -T size
194 Set the transposition table size to 2^size entries.
195 .TP
196 .B -v
197 Show version and patchlevel.
198 .TP
199 .B -x value
200 Use
201 .BR value
202 as the evaluation window
203 .BR xwndw.
204 .TP
205 .B -X
206 Use xshogi display mode (the default).
207 .SH "COMMANDS"
208 .PP
209 In addition to legal moves, the following commands are available as responses.
210 .B Note:
211 command names are determined by the 
212 .I language
213 file and may vary with the implementation. The default language is English.
214 .PP
215 .B alg
216 -- allow algebraic input (not implemented)
217 .PP
218 .B Awindow
219 -- change Alpha window (default score + 90)
220 .PP
221 .B Bwindow
222 -- change Beta window (default score - 90)
223 .PP
224 .B beep
225 -- toggles beeping after each move (default: on).
226 .PP
227 .B bd
228 -- updates the current board position on the display.
229 .PP
230 .B book
231 -- turns off use of the opening library.
232 .PP
233 .B both
234 -- causes the computer to play both sides of a shogi game.
235 .PP
236 .B black
237 -- causes the computer to take the white pieces, if the computer is to move
238 first.
239 .PP
240 .B bsave
241 -- saves a game to disk as a book textfile.  
242 The program will prompt the user for a file name.
243 .PP
244 .B gamein
245 -- toggles game mode time control. Assumes the time specified for time control
246 is the time for a complete game.  Input with the level command should be the
247 game time and the expected number of moves in a game.
248 .B go
249 command must be given.
250 .PP
251 .B coords
252 -- show coordinates on the display (visual only)
253 .PP
254 .B contempt
255 -- allows the value of 
256 .I contempt
257 to be modified.
258 .PP
259 .B debug
260 --  asks for a piece as color piece, as wb or bn, and shows its calculated value on
261 each square.
262 .PP
263 .B debuglevel
264 --  sets level of debugging output if compiled with debug options.
265 .PP
266 .B depth
267 -- allows the user to change the search depth of the program.  The maximum
268 depth is 29 ply.  Normally the depth is set to 29 and the computer
269 terminates its search based on elapsed time rather than depth.  If depth is
270 set to (say) 4 ply, the program will search until all moves have been
271 examined to a depth of 4 ply (with extensions up to 11 additional ply for
272 sequences of checks and captures).  If you set a maximum time per move and
273 also use the depth command, the search will stop at the specified time or
274 the specified depth, whichever comes first.
275 .PP
276 .B easy
277 -- toggles easy mode (thinking on opponents time) on and off. The default
278 is easy mode ON.  If easy mode is disabled, the keyboard is polled for
279 input every so often and when input is seen the search is terminated. It
280 may also be terminated with a
281 .I sigint.
282 .PP
283 .B edit
284 -- allows the user to set up a board position.
285
286 .B  #
287 - command will clear the board.
288
289 .B  c 
290 - toggle piece color. 
291
292 .B  .
293 - command will exit setup mode.
294
295 .B  p3b
296 - place a pawn on 3b
297
298 .B  p3b+
299 - place a promoted pawn on 3b
300
301 .B  p*
302 - place a pawn to the captured pieces
303
304 Pieces are entered by typing a letter (p,l,n,s,g,b,r,k) for
305 the piece followed by the coordinate.
306
307 The usual warning about the
308 .I language file
309 applies.
310 .PP
311 .B exit
312 -- exits gnushogi.
313 .PP
314 .B first
315 -- tells the computer to move first. Computer begins searching for a move.
316 (same as "go").
317 .PP
318 .B force
319 -- allows the user to enter moves for both
320 sides. To get the program to play after a sequence of moves
321 has been entered use the 'black' or 'white' commands.
322 .PP
323 .B get
324 -- retrieves a game from disk.  The program will
325 prompt the user for a file name.
326 .PP
327 .B hash
328 -- use/don't use hashfile.
329 .PP
330 .B hashdepth
331 -- allows the user to change the minimum depth for using the hashfile and
332 the number of moves from the beginning of the game to use it.
333 .PP
334 .B help
335 -- displays a short description of the commands and the current status of options.
336 .PP
337 .B go
338 -- tells the computer to move first. Computer begins searching for a move.
339 (same as "first").
340 .PP
341 .B hint
342 -- causes the program to supply the user with its predicted move.
343 .PP
344 .B level
345 -- allows the user to set time controls such as 60 moves in 5 minutes etc.
346 In tournament mode, the program will vary the time it takes for each move
347 depending on the situation.  If easy mode is disabled (using the 'easy'
348 command), the program will often respond with its move immediately, saving
349 time on its clock for use later on.
350 .PP
351 .B list
352 -- writes the game moves and some statistics on search depth, nodes, and
353 time to the file 'shogi.lst'.
354 .PP
355 .B material
356 -- toggle material flag - draws on no pawns and both sides < rook
357 .PP
358 .B new
359 -- starts a new game.
360 .PP
361 .B p
362 -- evaluates the board and shows the point score for each piece. The total score for
363 a position is the sum of these individual piece scores.
364 .PP
365 .B post
366 -- causes the program to display the principal variation and the score
367 during the search.  A score of 100 is equivalent to a 1 pawn advantage for
368 the computer.
369 .PP
370 .B quit
371 -- exits the game.
372 .PP
373 .B random
374 -- causes the program to randomize its move selection slightly.
375 .PP
376 .B rcptr
377 -- set recapture mode.
378 .PP
379 .B remove
380 -- backout the last level for both sides. Equal to 2 
381 .I undo's.
382 .PP
383 .B reverse
384 -- causes the board display to be reversed.  That
385 is, the black pieces will now appear at the top of the board.
386 .PP
387 .B rv
388 -- reverse board display.
389 .PP
390 .B save
391 -- saves a game to disk.  The program will prompt the user for a file name.
392 .PP
393 .B switch
394 -- causes the program to switch places with the opponent and begin
395 searching.
396 .PP
397 .B test
398 -- performs some speed tests for MoveList and CaptureList generation, and
399 ScorePosition position scoring for the current board.
400 .PP
401 .B time
402 -- set computer's time remaining, intended for synchronizing clocks among
403 multiple players.
404 .PP
405 .B tsume
406 -- toggle tsume mode. In tsume mode, not all possible moves will be
407 generated. If a king is in check, only moves that get the king out of check
408 are generated.  If the king is not in check, only moves that give check to
409 the opponent's king are generated.
410 .PP
411 .B undo
412 -- undoes the last move whether it was the computer's
413 or the human's. You may also type "remove". This is equivalent
414 to two "undo"'s (e.g. retract one move for each side).
415 .PP
416 .B white
417 -- causes the computer to take the black pieces, if the computer is to move
418 first the
419 .B go 
420 command must be given.
421 .PP
422 .B xget
423 -- read an 
424 .I xshogi
425 position file.
426 .PP
427 .B xsave
428 -- save as an 
429 .I xshogi
430 position file.
431 .PP
432 .B xwndw
433 -- change X window. The window around alpha/beta used to determine whether
434 the position should be scored or just estimated.
435 .SH BUGS
436 .PP
437 .fi
438 .SH SEE ALSO
439 .nf
440 xshogi(6)
441 .fi
442