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