4 - detection of repetitions can be wrong due to collision of hash keys and
5 limitation of history table size.
7 - detection of mates fails if all of pseudo-legal evasions are perpetual
8 checks. Father more, inferior evasions, such as unpromotion of
9 bishop, rook, and lance at 8th rank, are not counted for the mate
12 - detection of perpetual checks fails if one of those inferior
13 evasions makes a position that occurred four times.
17 - idirec && is_pinned_on_black_king();
22 - out_warning( "A node returns a value lower than mate." ); is obsolate.
26 - use IsDiscover macro
27 - change hash_store_pv()
31 - SHARE to all transition table
42 static int main_child( tree_t * restrict ptree );
46 main( int argc, char *argv[] )
52 tree_t * restrict ptree;
55 ptree = tlp_atree_work;
60 #if defined(CSASHOGI) && defined(_WIN32)
62 if ( argc != 2 || strcmp( argv[1], "csa_shogi" ) )
65 "The executable image is not intended\x0d"
66 "as an independent program file.\x0d"
67 "Execute CSA.EXE instead.",
68 str_myname, MB_OK | MB_ICONINFORMATION );
73 if ( ini( ptree ) < 0 )
75 out_error( "%s", str_error );
81 iret = main_child( ptree );
84 out_error( "%s", str_error );
88 else if ( iret == -2 )
90 out_warning( "%s", str_error );
94 else if ( iret == -3 ) { break; }
97 if ( fin() < 0 ) { out_error( "%s", str_error ); }
104 main_child( tree_t * restrict ptree )
108 #if defined(DEKUNOBOU)
109 if ( dek_ngame && ( game_status & mask_game_end ) )
112 if ( dek_next_game( ptree ) < 0 )
114 out_error( "%s", str_error );
122 iret = ponder( ptree );
123 if ( iret < 0 ) { return iret; }
124 else if ( game_status & flag_quit ) { return -3; }
126 /* move prediction succeeded, pondering finished,
127 and computer made a move. */
128 else if ( iret == 2 ) { return 1; }
130 /* move prediction failed, pondering aborted,
131 and we have opponent's move in input buffer. */
132 else if ( ponder_move == MOVE_PONDER_FAILED )
136 /* pondering is interrupted or ended.
137 do nothing until we get next input line. */
144 iret = next_cmdline( 1 );
145 if ( iret < 0 ) { return iret; }
146 else if ( game_status & flag_quit ) { return -3; }
149 iret = procedure( ptree );
150 if ( iret < 0 ) { return iret; }
151 else if ( game_status & flag_quit ) { return -3; }