/usr/share/doc/gnushogi/html/gnushogi.html is in gnushogi 1.4.2-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU Shogi manual: gnushogi</title>
<meta name="description" content="GNU Shogi manual: gnushogi">
<meta name="keywords" content="GNU Shogi manual: gnushogi">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Index.html#Index" rel="index" title="Index">
<link href="Index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html#Top" rel="up" title="Top">
<link href="References-and-links.html#References-and-links" rel="next" title="References and links">
<link href="Differences-between-shogi-and-chess.html#Differences-between-shogi-and-chess" rel="prev" title="Differences between shogi and chess">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="gnushogi"></a>
<div class="header">
<p>
Next: <a href="References-and-links.html#References-and-links" accesskey="n" rel="next">References and links</a>, Previous: <a href="About-shogi.html#About-shogi" accesskey="p" rel="prev">About shogi</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> [<a href="Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="gnushogi-1"></a>
<h2 class="chapter">3 gnushogi</h2>
<a name="index-gnushogi"></a>
<p>This section describes how to run the “gnushogi” program.
</p>
<p>SYNOPSIS
</p>
<p>gnushogi [ [[-]a] [-b bookfile] [-B binbookfile] [-C] [-h langfile]
[-L langfile] [-r length] [-R] [-s pathname] [-l pathname] [-S binbooksize]
[-t] [-c size] [-T size] [-v] [-x] [-X] arg1 arg2 ]
</p>
<p>DESCRIPTION
</p>
<p>GNU shogi (gnushogi) plays a game of japanese chess (shogi) against the
user or it plays against itself.
</p>
<p>At startup gnushogi reads the binbook file if it is present. It then
looks for a book file. If it is present it adds its contents to the
binbook data. If the binbook file is writable a new combined binbook
file is written.
</p>
<p>Gnushogi is a modified version of the gnuchess program. It has a simple
alphanumeric board display, or it can be used with the xshogi program
under X windows. The program gets its opening moves from the file
gnushogi.bbk which is located in a directory specified in the Makefile.
To invoke the program type:
</p>
<dl compact="compact">
<dt>‘<samp>gnushogi -C</samp>’</dt>
<dd><p>simple curses based version
</p>
</dd>
<dt>‘<samp>gnushogi -X (or just gnushogi)</samp>’</dt>
<dd><p>xshogi compatible version
</p>
</dd>
<dt>‘<samp>gnushogi -R</samp>’</dt>
<dd><p>raw test display version
</p></dd>
</dl>
<p>TIME CONTROLS
</p>
<p>If one argument is given, it is the search time per move in
[minutes:]seconds. So gnushogi 30 will generate one move every 30
seconds, while gnushogi 5:00 will generate one move every 5 minutes.
</p>
<p>If two or more arguments are given, they will be used to set tournament
time controls with the first argument of each pair being the number of
moves and the second being the total clock time in minutes[:seconds].
Thus, entering gnushogi 60 5 will set the clocks for 5 minutes (300
seconds) for the first 60 moves, and gnushogi 30 3:30 will allow 3
minutes and 30 seconds for 30 moves.
</p>
<p>gnushogi 30 5 1 :30 will allow 5 minutes for the first 30 moves and 30
seconds for each move after that. Up to 4 pairs of controls may be
specified.
</p>
<p>If no argument is given the program will prompt the user for level of
play.
</p>
<p>BOOK
</p>
<p>The book gnushogi.tbk consists of a sequence of openings. An opening
begins with a line starting with a # (the rest of the line is a comment).
Following this is a series of moves in algebraic notation alternating
between black and white separated by whitespace. A move may have a ?
after it indicating this move should never be made in this position. Moves
are stored as position:move so transpositions between openings can take
place.
</p>
<p>HASHFILE
</p>
<p>The hashfile if created should be on the order of 4 megabytes; you can
create such a hashfile by typing “gnushogi -c 22” (see below). This
file contains positions and moves learned from previous games. If a
hashfile is used the computer makes use of the experience it gained in
past games. Tests run so far show that it plays no worse with the
hashfile than without, but it is not clear yet whether it provides a
real advantage.
</p>
<p>LEGAL MOVES
</p>
<p>Note: Piece letters are determined by the language file. What is
specified here is the default (English).
</p>
<p>Once gnushogi is invoked, the program will display the board and prompt
the user for a move. To enter a move, use the notation 7g7f where the
first letter-number pair indicates the origin square and the second
letter-number pair indicates the destination square. An alternative is
to use the notation P7f where the first letter indicates the piece type
(P,L,N,S,G,B,R,K). To promote append a + the type of the new piece to
the move, as in 2d2c+ or P2c+. Note that you must use capital letters
for the pieces by default.
</p>
<p>COMMAND-LINE OPTIONS
</p>
<dl compact="compact">
<dt>‘<samp>-a</samp>’</dt>
<dd><p>Do not search on opponent’s time.
</p>
</dd>
<dt>‘<samp>a</samp>’</dt>
<dd><p>Do search on opponent’s time.
</p>
</dd>
<dt>‘<samp>-b <var>bookfile</var></samp>’</dt>
<dd><p>Use bookfile for opening book.
</p>
</dd>
<dt>‘<samp>-B <var>binbookfile</var></samp>’</dt>
<dd><p>Use binbookfile for binary opening book.
</p>
</dd>
<dt>‘<samp>-c <var>size</var></samp>’</dt>
<dd><p>Create a new HASHFILE. File size is 2^size entries of approximately 65+?
bytes.
</p>
</dd>
<dt>‘<samp>-C</samp>’</dt>
<dd><p>Use curses-based display mode.
</p>
</dd>
<dt>‘<samp>-h</samp>’</dt>
<dd><p>Do not use hashfile.
</p>
</dd>
<dt>‘<samp>h</samp>’</dt>
<dd><p>Do use hashfile.
</p>
</dd>
<dt>‘<samp>-l <var>pathname</var></samp>’</dt>
<dd><p>Pathname of the loadfile used with get or xget.
</p>
</dd>
<dt>‘<samp>-L <var>lang</var></samp>’</dt>
<dd><p>Use language lang from the file gnushogi.lang. If -L is not specified
it uses the first language in the file.
</p>
</dd>
<dt>‘<samp>-P <var>plylevels</var></samp>’</dt>
<dd><p>Number of plys to include in the binbookfile. For generating a
binbookfile.
</p>
</dd>
<dt>‘<samp>-r <var>length</var></samp>’</dt>
<dd><p>Rehash <em>length</em> times in searching entries for position in
transposition table.
</p>
</dd>
<dt>‘<samp>-R</samp>’</dt>
<dd><p>Use raw text display mode. This can be used for dumb terminals or for
systems that don’t have curses.
</p>
</dd>
<dt>‘<samp>-s <var>pathname</var></samp>’</dt>
<dd><p>Pathname of the save file to use with the save command.
</p>
</dd>
<dt>‘<samp>-S <var>size</var></samp>’</dt>
<dd><p>Size of binbookfile for memory based books. For creating a binbookfile.
</p>
</dd>
<dt>‘<samp>-t</samp>’</dt>
<dd><p>Show statistics for HASHFILE.
</p>
</dd>
<dt>‘<samp>-T <var>size</var></samp>’</dt>
<dd><p>Set the transposition table size to 2^size entries.
</p>
</dd>
<dt>‘<samp>-v</samp>’</dt>
<dd><p>Show version and patchlevel.
</p>
</dd>
<dt>‘<samp>-x <var>value</var></samp>’</dt>
<dd><p>Use value as the evaluation window xwndw.
</p>
</dd>
<dt>‘<samp>-X</samp>’</dt>
<dd><p>Use xshogi display mode (the default).
</p>
</dd>
</dl>
<p>COMMANDS
</p>
<p>In addition to legal moves, the following commands can be entered at the
gnushogi prompt. Note: command names are determined by the language
file and may vary with the implementation. The default language is
English.
</p>
<dl compact="compact">
<dt>‘<samp>alg</samp>’</dt>
<dd><p>allow algebraic input (not implemented).
</p>
</dd>
<dt>‘<samp>Awindow</samp>’</dt>
<dd><p>change Alpha window (default score + 90).
</p>
</dd>
<dt>‘<samp>Bwindow</samp>’</dt>
<dd><p>change Beta window (default score - 90).
</p>
</dd>
<dt>‘<samp>beep</samp>’</dt>
<dd><p>toggles beeping after each move (default: on).
</p>
</dd>
<dt>‘<samp>bd</samp>’</dt>
<dd><p>updates the current board position on the display.
</p>
</dd>
<dt>‘<samp>book</samp>’</dt>
<dd><p>turns off use of the opening library.
</p>
</dd>
<dt>‘<samp>both</samp>’</dt>
<dd><p>causes the computer to play both sides of a shogi game.
</p>
</dd>
<dt>‘<samp>black</samp>’</dt>
<dd><p>causes the computer to play as White, if the computer was to move
first.
</p>
</dd>
<dt>‘<samp>bsave</samp>’</dt>
<dd><p>saves a game to disk as a book textfile. The program will prompt the
user for a file name.
</p>
</dd>
<dt>‘<samp>gamein</samp>’</dt>
<dd><p>toggles game mode time control. Assumes the time specified for time
control is the time for a complete game. Input with the level command
should be the game time and the expected number of moves in a game. go
command must be given.
</p>
</dd>
<dt>‘<samp>coords</samp>’</dt>
<dd><p>show coordinates on the display (visual only).
</p>
</dd>
<dt>‘<samp>contempt</samp>’</dt>
<dd><p>allows the value of <em>contempt</em> to be modified.
</p>
</dd>
<dt>‘<samp>debug</samp>’</dt>
<dd><p>asks for a piece as color piece, as wb or bn, and shows its calculated
value on each square.
</p>
</dd>
<dt>‘<samp>debuglevel</samp>’</dt>
<dd><p>sets level of debugging output if compiled with debug options.
</p>
</dd>
<dt>‘<samp>depth</samp>’</dt>
<dd><p>allows the user to change the search depth of the program. The maximum
depth is 29 ply. Normally the depth is set to 29 and the computer
terminates its search based on elapsed time rather than depth. If depth
is set to (say) 4 ply, the program will search until all moves have been
examined to a depth of 4 ply (with extensions up to 11 additional ply
for sequences of checks and captures). If you set a maximum time per
move and also use the depth command, the search will stop at the
specified time or the specified depth, whichever comes first.
</p>
</dd>
<dt>‘<samp>easy</samp>’</dt>
<dd><p>toggles easy mode (thinking on opponents time) on and off. The default
is easy mode ON. If easy mode is disabled, the keyboard is polled for
input every so often and when input is seen the search is terminated. It
may also be terminated with a sigint.
</p>
</dd>
<dt>‘<samp>edit</samp>’</dt>
<dd><p>allows the user to set up a board position.
</p><ul class="no-bullet">
<li>- #
clear the board.
</li><li>- c
toggle piece color.
</li><li>- .
command will exit setup mode.
</li><li>- p3b
place a pawn on 3b
</li><li>- p3b+
place a promoted pawn on 3b
</li><li>- p*
place a pawn in hand (among the captured pieces)
</li></ul>
<p>Pieces are entered by typing a letter (p,l,n,s,g,b,r,k) for
the piece followed by the coordinate. Here, letter case is ignored.
</p>
<p>The usual warning about the language file applies.
</p>
</dd>
<dt>‘<samp>exit</samp>’</dt>
<dd><p>exits gnushogi.
</p>
</dd>
<dt>‘<samp>first</samp>’</dt>
<dd><p>tells the computer to move first. Computer begins searching for a move.
(same as “go”).
</p>
</dd>
<dt>‘<samp>force</samp>’</dt>
<dd><p>allows the user to enter moves for both sides. To get the program to
play after a sequence of moves has been entered use the “black” or
“white” commands.
</p>
</dd>
<dt>‘<samp>get</samp>’</dt>
<dd><p>retrieves a game from disk. The program will prompt the user for a file
name.
</p>
</dd>
<dt>‘<samp>go</samp>’</dt>
<dd><p>tells the computer to move first. Computer begins searching for a move.
(same as “first”).
</p>
</dd>
<dt>‘<samp>hash</samp>’</dt>
<dd><p>use/don’t use hashfile.
</p>
</dd>
<dt>‘<samp>hashdepth</samp>’</dt>
<dd><p>allows the user to change the minimum depth for using the hashfile and
the number of moves from the beginning of the game to use it.
</p>
</dd>
<dt>‘<samp>help</samp>’</dt>
<dd><p>displays a short description of the commands and the current status of
options.
</p>
</dd>
<dt>‘<samp>hint</samp>’</dt>
<dd><p>causes the program to supply the user with its predicted move.
</p>
</dd>
<dt>‘<samp>level</samp>’</dt>
<dd><p>allows the user to set time controls such as 60 moves in 5 minutes etc.
In tournament mode, the program will vary the time it takes for each
move depending on the situation. If easy mode is disabled (using the
“easy” command), the program will often respond with its move
immediately, saving time on its clock for use later on.
</p>
</dd>
<dt>‘<samp>list</samp>’</dt>
<dd><p>writes the game moves and some statistics on search depth, nodes, and
time to the file “shogi.lst”.
</p>
</dd>
<dt>‘<samp>material</samp>’</dt>
<dd><p>toggle material flag - draws on no pawns and both sides < rook.
</p>
</dd>
<dt>‘<samp>new</samp>’</dt>
<dd><p>starts a new game.
</p>
</dd>
<dt>‘<samp>p</samp>’</dt>
<dd><p>evaluates the board and shows the point score for each piece. The total
score for a position is the sum of these individual piece scores.
</p>
</dd>
<dt>‘<samp>post</samp>’</dt>
<dd><p>causes the program to display the principal variation and the score
during the search. A score of 100 is equivalent to a 1 pawn advantage
for the computer.
</p>
</dd>
<dt>‘<samp>quit</samp>’</dt>
<dd><p>exits the game.
</p>
</dd>
<dt>‘<samp>random</samp>’</dt>
<dd><p>causes the program to randomize its move selection slightly.
</p>
</dd>
<dt>‘<samp>rcptr</samp>’</dt>
<dd><p>set recapture mode.
</p>
</dd>
<dt>‘<samp>remove</samp>’</dt>
<dd><p>backout the last level for both sides. Equal to 2 undo’s.
</p>
</dd>
<dt>‘<samp>reverse</samp>’</dt>
<dd><p>causes the board display to be reversed. That is, the Black’s pieces will
now appear at the top of the board.
</p>
</dd>
<dt>‘<samp>rv</samp>’</dt>
<dd><p>reverse board display.
</p>
</dd>
<dt>‘<samp>save</samp>’</dt>
<dd><p>saves a game to disk. The program will prompt the user for a file name.
</p>
</dd>
<dt>‘<samp>switch</samp>’</dt>
<dd><p>causes the program to switch places with the opponent and begin
searching.
</p>
</dd>
<dt>‘<samp>test</samp>’</dt>
<dd><p>performs some speed tests for MoveList and CaptureList generation, and
ScorePosition position scoring for the current board.
</p>
</dd>
<dt>‘<samp>time</samp>’</dt>
<dd><p>set computer’s time remaining, intended for synchronizing clocks among
multiple players.
</p>
</dd>
<dt>‘<samp>tsume</samp>’</dt>
<dd><p>toggle tsume mode. In tsume mode, not all possible moves will be
generated. If a king is in check, only moves that get the king out of
check are generated. If the king is not in check, only moves that give
check to the opponent’s king are generated.
</p>
</dd>
<dt>‘<samp>undo</samp>’</dt>
<dd><p>undoes the last move whether it was the computer’s or the human’s. You
may also type “remove”. This is equivalent to two “undo”’s
(e.g. retract one move for each side).
</p>
</dd>
<dt>‘<samp>white</samp>’</dt>
<dd><p>causes the computer to play as Black; if the computer is to move
first the go command must be given.
</p>
</dd>
<dt>‘<samp>xget</samp>’</dt>
<dd><p>read an xshogi position file.
</p>
</dd>
<dt>‘<samp>xsave</samp>’</dt>
<dd><p>save as an xshogi position file.
</p>
</dd>
<dt>‘<samp>xwndw</samp>’</dt>
<dd><p>change X window. The window around alpha/beta used to determine whether
the position should be scored or just estimated. Note: this has
<em>nothing</em> to do with xshogi or X windows; the terms are completely
separate.
</p>
</dd>
</dl>
<hr>
<div class="header">
<p>
Next: <a href="References-and-links.html#References-and-links" accesskey="n" rel="next">References and links</a>, Previous: <a href="About-shogi.html#About-shogi" accesskey="p" rel="prev">About shogi</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> [<a href="Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|