Implement exclude-moves feature
[bonanza.git] / readme.txt
1 ----------------------------------------------------------------------
2                         Bonanza 6.0 - Client Source Code
3                                             Kunihito Hoki, May 2011
4 ----------------------------------------------------------------------
5
6
7 1. Introduction
8 ----------------
9
10 Bonanza is a state-of-the art computer shogi engine which runs on
11 Windows and Linux machines, and this directory contains a
12 platform-independent source code.
13
14 This source code is distributed with a hope that it will be useful in
15 addition to the main part of the shogi engine. This program includes
16 many useful functions such as manipulating a shogi board, reading and
17 writing a CSA record file, speaking of a CSA protocol with a socket
18 communication, and controlling time, and etc.. I believe this program
19 can be a good starting point if you are interested in making shogi
20 programs.
21
22 One main feature of this program is that it employs a brute-force
23 search method together with bitboard techniques as many chess programs
24 do. Another notable feature is a machine learning of shogi evaluation
25 functions. The details of the learning algorithm (aka Bonanza method)
26 were already presented [1], and this source code provides an example
27 of implementation of the learning method.
28
29 I admit that some parts of the source code are cryptic, e.g. codes in
30 "mate1ply.c". I hope that I will have some time to make a quality
31 documentation and comments on the program code, or someone else could
32 decrypt my program and provide a documentation.
33
34 Any comments or suggestions are welcome [2].
35
36 [1] K. Hoki, "Optimal control of minimax search results to learn
37     positional evaluation", Game Programming Workshop, Hakone, Japan
38     2008.
39
40 [2] Contact to "bonanza_query [at] hotmail.com".
41
42
43 2. Legal Notices
44 -----------------
45
46 This program is protected by copyright. Without a specific 
47 permission, any means of commercial applications are prohibited.
48 Furthermore, this program is distributed without any warranty.
49 Within these limits, you can use, redistribute, and/or modify it.
50
51
52 3. Change Logs
53 ---------------
54
55 Version 6.0
56
57 Search() function is modified to ignore moves which receive negative
58 values from Static Exchange Evaluation (SEE) at frontier and
59 pre-frontier nodes. Self-play experiments showed that this modification
60 makes Bonanza slightly stronger. Similar results were also observed in
61 experiments using a shogi program YSS,
62 http://www32.ocn.ne.jp/~yss/horizon.txt. Moreover, the branch cut by
63 means of SEE at frontier nodes can also be found in a chess program,
64 Stockfish.
65
66 Now Bonanza does Late Move Reduction (LMR) at root nodes, and recursive
67 iterative deepening more often. Self-play experiments showed that these
68 modifications make Bonanza slightly stronger.
69
70 DFPN searcher is added to the set of Bonanza source codes (dfpn.c,
71 dfpn.h, and dfpnhash.c). You can use the searcher by using 'dfpn'
72 command with a compile option -DDFPN turned on. To make use of the DFPN
73 searcher in ordinary search, use 'dfpn_client' command with a compile
74 option -DDFPN_CLIENT turned on. To provide a proper service to the DFPN
75 client, you also need to use a server script 'src/server/dfpn_server.pl'
76 with one or more DFPN worker(s) connected with 'dfpn connect' command.
77 I am thankful to Dr. A. Nagai for his kind and fruitful advice.
78
79 Now Bonanza can be a client of parallel searches using cluster computing
80 environment with mnj command. 'src/server/parallel_server.pl' is a
81 server script of root-node parallelizations, and the server can be a
82 client of majority voting cluster computation.
83
84 Some techniques which increase computational efficiency of Bonanza are
85 reported by E. Ito, http://aleag.cocolog-nifty.com/. In his website,
86 two ideas are shown, i.e., (i) speed up of the computation of the static
87 evaluation function, and (2) use of SSE instructions of Intel processors
88 for bitboard operations. By adopting his ideas to Bonanza, NPS value
89 nearly doubled. This is amazing. To use SSE instructions, specify -DSSE2
90 or -DSSE4 compiler option. I am thankful to Mr. E. Ito for his kind and
91 fruitful advice.
92
93 -DINANIWA_SHIFT compilation flag is supplied to enable an Inaniwa-strategy detection
94
95 There are many other modifications and bug fixes.
96
97
98 Feliz 0.0
99
100 - Some results from Y. Sato's experiments with Bonanza inspired me
101   to use the history table in LMR in Shogi, as Fruit did in chess. By
102   doing so, some improvement in performance of the tree search is
103   made.
104
105 - From private communications with Yaneurao, it turned out that the
106   3-ply-mate detections in 'mate3.c' can search game trees more
107   efficiently by using several heuristic pruning techniques. Now
108   'mate3.c' adopts some of these techniques.
109
110 - E. Ito kindly reported two bugs in the source codes. One is in
111   hash_store(), and the other is in ehash_probe() and
112   ehash_store(). Now these are fixed.
113
114 - The structure of history table is modified from 'square-to' and
115   'square-from' method to an exact match method by using the perfect
116   hash technique. The hash function of moves in 'phash.c' is generated
117   by codes at http://burtleburtle.net/bob/hash/perfect.html.
118
119 - A command 'mnj' is added to connect to the cluster-computing server
120   in src/cluster/.
121
122 - In client_next_game(), the way of dealing with REJECT message from a
123   CSA Shogi server is revised. Now Bonanza connects to the server again
124   when the game is rejected by an opponent.
125
126
127 Version 4.1.3
128 - The owner of 'LS3600 Blog Webpage' pointed out that there were two
129   serious bugs. Thank you very much! According to his indication,
130   is_hand_eq_supe() in 'utility.c' and read_CSA_line() in 'csa.c' are
131   revised.
132 - In MPV code in 'searchr.c', a test of 'root_abort' flag had been
133   forgotten. Now the flag is tested after every call of search().
134 - 'lan.txt' is added to 'src/executable/' directory. This is an
135   example of an input sequence to connect to CSA Shogi server.
136 - 'book.bin' now has smaller moves and positions than previous one does.
137   Also, 'book_anti.csa' is added to 'src/executable/' directory. This
138   is an example of bad moves which apear in records of human experts.
139 - 'Legal Notices' in this document is corrected.
140
141 Version 4.1.2
142 - In 'Makefile' and 'Makefile.vs', targets which require profile-guided
143   optimization are removed. Furthermore, an option, which controls
144   optimization, has been reverted from the aggressive flag, -O3, to a
145   moderate one, '-O2'. These modifications were necessary for avoiding
146   abnormal terminations of the program.
147 - In 'ini.c', the attribute of POSIX thread in a global-variable
148   'pthread_attr' is set to 'detach-state'. Because threads will never
149   join with any other threads in this program, the thread should be
150   created in the detached state to free system resources.
151 - In 'ini.c', the default size of the transposition table is lifted
152   from 12MByte to 48MByte.
153 - In 'iterate.c", probing the opening book is avoided when the move
154   history of a current game has repetitions.
155 - In 'shogi.h', the margins of futility pruning are increased in
156   accord with new positional evaluation of the feature vector in
157   'fv.bin'.
158 - The quality of an opening book, 'winbin/book.bin', has been improved
159   at the expense of quantity.
160
161 Version 4.1.0 and 4.1.1 (26 Apr 2009)
162 - In 'Makefile' and 'Makefile.vs', some options of Intel C compiler
163   are modified. Here, agressive optimization '-O3' is substituted for
164   the default '-O2', pthreads support '-pthread' is substituted for
165   '-lpthread', and an obsolete '-static-libcxx' is removed.
166 - In 'Makefile', the conformance of GNU C and Intel C compilers are
167   set to GNU extensions of ISO C99 by setting '-std=gnu99' because a
168   POSIX function 'strtok_r()' is not in the C99 standard library.
169 - In 'Makefile', targets for GNU C with gprof and profile-guided
170   optimization of GNU C are removed.
171 - In 'shogi.h', inline assemblies and intrinsics are used on x86-64 as
172   well as x86. To detect the targets, pre-defined macros '__i386__'
173   and '__x86_64__' are examined.
174 - In 'evaluate.c', the evaluation function looks up the table
175   'stand_pat[ply]' to see if the position have been evaluated since
176   the previous move is made by 'make_move_[bw]()' functions. Also, the
177   evaluation function probes the hash table 'ehash_tbl[]' to avoid
178   re-evaluation of the same position.
179 - In 'io.c', an immediate value 0 is substituted for 'fileno(stdin)'
180   because the POSIX function 'fileno()' is not part of ANSI C. POSIX
181   requires that the file descriptor associated with 'stdin' be 0.
182 - In 'iterate.c', a criterion for aging of transposition-table, i.e.,
183   increment of a global variable 'trans_table_age', is lifted from 7%
184   to 9% of saturation ratio of the table.
185 - In 'learn1.c', the macro 'SEARCH_DEPTH' is set to 2. The macro
186   specifies the depth threashold of searches for finding all of
187   principle variations of positions in a set of games.
188 - In 'learn1.c', a step size of increment/decrement of feature vectors
189   is fixed to 1 in 'learn_parse2()' function.
190 - In 'hash.c', when a node can be pruned by using a hash value based on
191   futility pruning, a return value of the node is set to beta.
192 - In 'rand.c', some codes of initialization of PRNG variables are
193   moved to 'ini_genrand()' from 'ini()' function.
194 - In 'sckt.c', a function 'send_crlf()' is removed.
195 - In 'search.c', now 'search()' calls 'search_quies()' and returns if
196   a search depth reaches a threashold. So that we can call 'search()'
197   function anytime, and this makes source codes simple.
198 - In 'search.c', the static evaluation value is evaluated and used to
199   see if the late-move reduction is applicable or not. The evaluation
200   value is also used by the futility pruning.
201 - In 'search.c', the futility pruning is not applied if the node is in
202   check or the move is a check.
203 - In 'search.c', now Bonanza sends the keep-alive command '0x0a' to
204   the server in 'detect_signals()'.
205 - In 'time.c', 'set_seach_limit_time()' is simplified.
206 - In 'time.c', the second argument of 'gettimeofday()' is set to 'NULL'.
207
208 Version 4.0.4 (2 Feb 2009)
209 - An error of GCC inline assembly for spinlock in "thread.c" is fixed.
210 - In Windows OS, Bonanza now opens all streams with file sharing by
211   using "_SH_DENYNO" constant in "io.c".
212 - GCC built-in functions are substituted for GCC inline assemblies for
213   bit-scan operations in "bitop.h". Furthermore, "bitop.h" is removed,
214   and some of macros in the header are integrated into "shogi.h".
215
216 Version 4.0.3 (Jan 2008)
217
218
219 4. Files
220 ---------
221
222 Here is a list of files you can find in this directory.
223
224 C headers
225 - param.h     piece values
226 - shogi.h     main header
227 - bitop.h     bit operations
228 - dfpn.h      header of DFPN codes
229
230 basic C functions
231 - main.c      main function of C program
232 - data.c      definition of global variables
233 - ini.c       initializations
234 - rand.c      pseudo random number generator
235 - time.c      time functions
236 - bitop.c     bit operations
237 - utility.c   misc. functions
238
239 I/O
240 - proce.c     input procedures
241 - csa.c       csa file format I/O
242 - io.c        basic I/O
243 - sckt.c      Socket communications
244
245 bitboard manipulations
246 - attack.c    piece attacks
247 - genchk.c    move generation (checks)
248 - genevasn.c  move generation (evasions)
249 - gendrop.c   move generation (drops)
250 - gennocap.c  move generation (non-captures)
251 - gencap.c    move generation (captures)
252 - movgenex.c  move generation (inferior moves)
253 - makemove.c  make moves
254 - unmake.c    unmake move
255 - mate1ply.c  1-ply mate detection
256 - debug.c     examine bitboard validity
257
258 brute-force search
259 - iterate.c   iterative deepning search at root node
260 - searchr.c   alpha-beta search at root node
261 - search.c    alpha-beta search
262 - next.c      obtains next move
263 - quiesrch.c  quiescence search
264 - evaluate.c  static eveluation function
265 - evaldiff.c  easy and fast evaluation function
266 - swap.c      static exchange evaluation
267 - hash.c      transposition table
268 - phash.c     perfect hash function of moves
269 - thread.c    thread-level parallelization
270 - root.c      root move genelation and shallow min-max search
271 - mate3.c     3-ply mate detection
272 - ponder.c    pondering
273 - book.c      creates and probes opening book
274 - problem.c   auto problem solver
275 - valid.c     examine move validity
276
277 DFPN search
278 - dfpn.c      DFPN search
279 - dfpnhash.c  Hashing for DFPN search
280
281 optimal control of min-max search
282 - learn1.c    main functions
283 - learn2.c    feture vector manipuration
284
285 misc.
286 - bonanza.txt which now you are looking at
287 - Makefile    makefile for gnu make.exe
288 - Makefile.vs makefile for Microsoft nmake.exe
289 - bonanza.ico icon file for windows
290 - bonanza.rc  resource-definition file for windows
291 - lan.txt     example of input sequence to connect CSA Shogi server
292 - book_anti.csa example of a set of bad moves which apear in records
293               of human exparts. This is used by 'book create' command.
294
295 4. How to build Bonanza
296 -----------------------
297
298 You can build Bonanza by means of GNU Make on Linux or Microsoft NMAKE
299 on Windows. Here is some examples:
300
301 - GCC on Linux
302 > make -f Makefile gcc
303
304 - Intel C++ Compiler on Linux
305 > make -f Makefile icc
306
307 - Microsoft C/C++ Compiler on Windows
308 > nmake -f Makefile.vs cl
309
310 - Intel C++ Compiler on Windows
311 > nmake -f Makefile.vs icl
312
313 The C source codes are written by using ANSI C plus a small number of
314 new features in ISO C99. Therefore, I think this can be easily built
315 in many platforms without much effort.
316
317 It may be necessary to define some macros in Makefile or
318 Makefile.vs. The macros are:
319
320 - NDEBUG (DEBUG)    builds release (debug) version of Bonanza
321
322 - MINIMUM           disables some auxiliary functions that are not
323                     necessary to play a game, e.g., book composition
324                     and optimization of evaluation functions
325
326 - TLP               enables thread-level parallel search
327
328 - MPV               enables multi-PV search
329
330 - CSA_LAN           enables Bonanza to communicate by CSA Shogi TCP/IP
331                     protcol
332
333 - DEKUNOBOU         enables dekunobou interface (available only for
334                     Windows)
335
336 - CSASHOGI          builds an engine for CSA Shogi (available only for
337                     Windows)
338
339 - NO_LOGGING        suppresses dumping log files
340
341 - HAVE_SSE2         use SSE2 instructions for speed
342
343 - HAVE_SSE4         use SSE2 and SSE4.1 instructions for speed
344
345 - MNJ_LAN           enables a client-mode of cluster searches
346
347 - INANIWA_SHIFT     enables an Inaniwa strategy detection
348
349 - DFPN              build the DFPN worker of mate-problems server
350
351 - DFPN_CLIENT       enables the client-mode of mate-problem server
352
353
354 Bonanza is an application that does not provide graphical user
355 interface. If you could build "bonanza.exe" properly without CSASHOGI
356 macro, it shows a prompt "Black 1>" when you execute it at a computer
357 console.
358
359 Bonanza uses three binary files: a feature vector of static evaluation
360 function "fv.bin",  an opening book "book.bin", and a
361 position-learning database "hash.bin". You can find these in "winbin/"
362 directory. Without the NO_LOGGING option, Bonanza must find "log/"
363 directory to dump log files.
364
365
366 5. Command List
367 ---------------
368
369 - analyze
370     Starts to ponder on the current position, until a command is
371     received. After a 'move' or 'undo' command pondering will continue
372     in the new position. To get out of this mode without side effects,
373     you can use the 'exit' command.
374
375 - beep on
376 - beep off
377     These commands enable (on) or disable (off) a beep when Bonanza
378     makes a move.  The default is on.
379
380 - book on
381 - book off
382     These commands enable (on) or disable (off) to probe the opening
383     book, "./book.bin".  The default is on.
384
385 - book narrow
386 - book wide
387     When the command with "narrow" is used, Bonanza selects a book
388     move from a small set of opening moves. The default is "wide". The
389     narrowing of the opening moves is useful if you want Bonanza
390     choose a common opening line.
391
392 - book create
393     This command creates the opening book file, "./book.bin", by using
394     numerous experts' games in a single CSA record file, "./book.csa".
395     It also uses another CSA record file, "book_anti.csa", where you
396     can register bad moves that may appear in the experts' games at
397     the last moves in the record file. Here is the example:
398
399     ----------------------------------------
400     PI, +, +6978KI, %TORYO
401     /
402     PI, +, +6978KI, -8384FU, %TORYO
403     /
404     PI, +, +7776FU, -4132KI, %TORYO
405     /
406     PI, +, +7776FU, -4132KI, +2726FU, %TORYO
407     ----------------------------------------
408
409     This command becomes effective when MINIMUM macro is not defined
410     in the Makefile.
411
412 - connect 'addr' 'port' 'id' 'passwd' ['ngame']
413     This command connects Bonanza to a shogi server by using the CSA
414     protocol. The first four arguments specify the network address,
415     port number, user ID, and password, respectively. The last
416     argument limits a number of games that will be played by Bonanza.
417     This command becomes effective when CSA_LAN macro is defined in
418     the Makefile.
419
420 - dfpn go
421     Bonanza does DFPN search at a current position.
422
423 - dfpn hash 'num'
424     This command is used to initialize the transposition table of
425     DFPN search and set the size of the table to 2^'num'. This
426     command becomes effective when DFPN macro is defined in the
427     Makefile.
428
429 - dfpn connect 'hostname' 'port#' 'ID'
430     This command is used to connect to the server script
431     dfpn_server.pl as a worker. This command becomes effective when
432     DFPN macro is defined in the Makefile.
433
434 - dfpn_client 'hostname' 'port#'
435     This command is used to connect to the server script
436     dfpn_server.pl as a client. With this, a root and its child
437     posittions are examined by the DFPN worker(s). This command
438     becomes effective when DFPN_CLIENT macro is defined in the
439     Makefile.
440
441 - display ['num']
442     This command prints the shogi board. If you want to flip the
443     board, set 'num' to 2. If not, set it to 1.
444
445 - s
446     Bonanza makes a prompt reply while thinking as soon as this
447     command is used.
448
449 - hash 'num'
450     This command is used to initialize the transposition table and
451     set the size of the table to 2^'num'.
452
453 - hash learn create
454     This command is used to make a zero-filled position-lerning
455     database, "hash.bin". This command becomes effective when MINIMUM
456     macro is not defined in the Makefile.
457
458 - hash learn on
459 - hash learn off
460     These commands enable (on) or disable (off) the position learning.
461     The default is on.
462
463 - learn 'str' 'steps' ['games' ['iterations' ['num1' ['num2']]]]
464     This command optimizes a feature vector of the static evaluation
465     function by using numorous experts' games in a single CSA record
466     file, "./records.csa". If you want to use a zero-filled vector as
467     an initial guess of the optimization procedure, set 'str' to
468     "ini". If not, set it to "no-ini". The third argument 'games' is a
469     number of games to be read from the record file. If the third
470     argument is negative or omitted, all games are read from the file.
471
472     The learning method iterates a set of procedures, and the number
473     of iteration can be limited by the fourth argument. It continues
474     as long as the argument is negative. The procedures consist of two
475     parts. The first part reads the record file and creates principal
476     variations by using 'num1' threads. The default value of 'num1' is
477     1. The second part renews the feature vector 'steps' times by using
478     'num2' threads in accord with the principal variations. The default
479     value of 'steps' and 'num2' is 1. Note that each thread in the
480     second procedure uses about 500MByte of the main memory. The two
481     arguments 'num1' and 'num2' become effective when TLP macro is
482     defined in the Makefile. After the procedures, the optimized
483     vector is saved in "./fv.bin". This command become effective when
484     MINIMUM macro is not defined in the Makefile.
485
486 - limit depth 'num'
487     This command is used to specify a depth, 'num', at which Bonanza
488     ends the iterative deepening search.
489
490 - limit nodes 'num'
491     When this command is used, Bonanza stops thinking after searched
492     nodes reach to 'num'.
493
494 - limit time 'minute' 'second' ['depth']
495     This command limits thinking time of Bonanza. It tries to make
496     each move by consuming the time 'minute'. When the time is spent
497     all, it makes each move in 'second'. The last argument 'depth' can
498     be used if you want Bonanza to stop thinking after the iterative
499     deepening searches reach sufficient depth.
500
501 - limit time extendable
502 - limit time strict
503     The command, "limit time extendable", allows Bonanza to think
504     longer than the time limited by the previous command if it wishes
505     to. The default is "strict".
506
507 - mnj 'sd' 'seed' 'addr' 'port' 'id' 'factor' 'stable_depth'
508     This command connects Bonanza to the majority or parallel server in
509     src/server/. The first two integers specify the standard
510     deviation and initial seed of pseudo-random numbers which are
511     added to the static evaluation function. Experiments suggested
512     that an appropriate value for the standard deviation is 15. Note
513     that all clients should use different seeds. The following three
514     arguments are network address, port number, user ID,
515     respectively. You can specify factor as a voting weight. Also
516     stable_depth is useful to detect opening positions. Here, when
517     Bonanza reaches the specified depth, then this is reported to the
518     server to reduce thinking time. This command becomes effective
519     when MNJ_LAN macro is defined in the Makefile.
520
521 - move ['str']
522     Bonanza makes a move of 'str'. If the argument is omitted, Bonanza
523     thinks of its next move by itself.
524
525 - mpv num 'nroot'
526 - mpv width 'threshold'
527     These commands control the number of root moves, 'nroot', to
528     constitute principal variations. The default number is 1. A root
529     move that yields a smaller value than the best value by 'threshold'
530     is neglected. The default threshold is about 200. These commands
531     become effective when MPV macro is defined in the Makefile.
532
533 - new ['str']
534     This command initializes the shogi board. The argument 'str'
535     controls an initial configuration of the board.  If you want to
536     play a no-handicapped game, set 'str' to "PI" and this is the
537     default value. In a handicapped game, specify squares and pieces
538     to drop, e.g. "new PI82HI22KA" or "new PI19KY".
539
540 - peek on
541 - peek off
542     The command "peek on (off)" enables (disables) peeks at a buffer
543     of the standard input file while Bonanza is thinking. The default
544     is on. This command is useful when you want to process a set of
545     commands as "> ./bonanza.exe < infile".
546
547 - ping
548     Prompt Bonanza to print "pong".
549
550 - ponder on
551 - ponder off
552     The command "ponder on (off)" enables (disables) thinks on the
553     opponent's time. The default is on.
554
555 - problem ['num']
556     This command is used to solve problems in "./problem.csa". Here
557     is an example of the problem file.
558
559     -----------------------------
560     $ANSWER:+0024FU
561     P1-KY-KE-OU-KI *  *  *  * -KY
562     P2 *  *  *  *  * -KI *  *  * 
563     P3 *  * -FU-GI-FU * -KE * -KA
564     P4-FU *  * -FU-GI-FU-HI * -FU
565     P5 *  *  *  *  *  *  * -FU+KY
566     P6+FU+KA+FU+FU+GI+FU+KI *  * 
567     P7 * +FU *  * +FU *  *  *  * 
568     P8 * +OU+KI+GI *  * +HI *  * 
569     P9+KY+KE *  *  *  *  * +KE * 
570     P+00FU00FU
571     P-00FU00FU00FU
572     +
573     /
574     $ANSWER:+0087KY:+0088KY
575     P1-OU-KE *  *  *  *  * +GI * 
576     P2-KY-KI *  *  *  *  *  *  * 
577     P3-FU-HI * -KI *  * -GI *  * 
578     P4 *  * -KE *  *  *  *  * -FU
579     P5 * +GI * -FU-FU-FU-FU-FU * 
580     P6+FU+HI-FU *  *  *  *  *  * 
581     P7 *  *  * +FU *  *  *  * +FU
582     P8 *  * +OU+KI+KI *  *  *  * 
583     P9+KY+KE *  *  *  *  * +KE+KY
584     P+00KA00GI00KY00FU00FU
585     P-00KA00FU00FU00FU00FU00FU
586     +
587     -----------------------------
588
589     The argument 'num' specifies the number of problems to solve.
590
591 - quit
592     The quit command and EOF character will exit Bonanza.
593
594 - read 'filename' [(t|nil) ['num']]
595     This command is used to read a CSA record 'filename' up to 'num'
596     moves. Set the second argument to "nil" when you want to ignore
597     time information in the record. The default value is "t". Bonanza
598     reads all move sequence if the last argument is neglected. If
599     'filename' is ".", the command reads an ongoing game from the
600     initial position.
601
602 - resign
603     Use this command when you resign a game.
604
605 - resign 'num'
606     This command specifies the threshold to resign. 'num' is a value
607     of the threshold. The default is around 1000.
608
609 - stress on
610 - stress off
611     When the command "stress on" is used, last-move shown in shogi
612     board is stressed. The default is on.
613
614 - time remain 'num1' 'num2'
615     This command tells Bonanza the remaining time. 'num1' ('num2') is
616     the remaining time of black (white) in seconds.
617
618 - time response 'num'
619     This command specifies a margin to control time. The time margin
620     saves Bonanza from time up due to TCP/IP communication to a server
621     program, sudden disc access, or imperfection of time control of
622     Bonanza. 'num' is the time margin in milli-second. The default
623     value is 200.
624
625 - tlp 'num'
626     This command controls the number of threads to be created when
627     Bonana considers a move to make. The command becomes effective
628     when TLP macro is defined in the Makefile. 'num' is the number of
629     threads. The default value is 1.
630
631 - undo
632     This command causes the latest move to be taken back.
633
634 - #
635     A line beginning with # causes all characters on that line
636     to be ignored.
637
638 - [move command]
639     A move command consists of four digits followed by two
640     capital alphabets, e.g. 7776FU. The first two digits
641     are a starting square and the last two are a target square. The
642     starting square is "OO" if the  move is a dorp, e.g. 0087FU. The
643     following two alphabets specify a piece type as the following,
644
645       FU - pawn             (Fuhyo)       TO - promoted pawn    (Tokin)
646       KY - lance            (Kyousha)     NY - promoted lance   (Narikyo)
647       KE - knight           (Keima)       NK - promoted knight  (Narikei)
648       GI - silver general   (Ginsho)      NG - promoted silver  (Narigin)
649       KI - gold general     (Kinsyo)
650       KA - Bishop           (Kakugyo)     UM - Dragon horse     (Ryuma)
651       HI - Rook             (Hisha)       RY - Dragon king      (Ryuo)
652       OU - King             (Osho)
653
654     Here, words in parentheses are romanization of Japanese words.
655