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 Out("feature done=0\n");
58 ptree = tlp_atree_work;
63 #if defined(CSASHOGI) && defined(_WIN32)
65 if ( argc != 2 || strcmp( argv[1], "csa_shogi" ) )
68 "The executable image is not intended\x0d"
69 "as an independent program file.\x0d"
70 "Execute CSA.EXE instead.",
71 str_myname, MB_OK | MB_ICONINFORMATION );
76 if ( ini( ptree ) < 0 )
78 out_error( "%s", str_error );
84 iret = main_child( ptree );
87 out_error( "%s", str_error );
91 else if ( iret == -2 )
93 out_warning( "%s", str_error );
97 else if ( iret == -3 ) { break; }
100 if ( fin() < 0 ) { out_error( "%s", str_error ); }
107 main_child( tree_t * restrict ptree )
111 #if defined(DEKUNOBOU)
112 if ( dek_ngame && ( game_status & mask_game_end ) )
115 if ( dek_next_game( ptree ) < 0 )
117 out_error( "%s", str_error );
125 iret = ponder( ptree );
126 if ( iret < 0 ) { return iret; }
127 else if ( game_status & flag_quit ) { return -3; }
129 /* move prediction succeeded, pondering finished,
130 and computer made a move. */
131 else if ( iret == 2 ) { return 1; }
133 /* move prediction failed, pondering aborted,
134 and we have opponent's move in input buffer. */
135 else if ( ponder_move == MOVE_PONDER_FAILED )
139 /* pondering is interrupted or ended.
140 do nothing until we get next input line. */
147 iret = next_cmdline( 1 );
148 if ( iret < 0 ) { return iret; }
149 else if ( game_status & flag_quit ) { return -3; }
152 iret = procedure( ptree );
153 if ( iret < 0 ) { return iret; }
154 else if ( game_status & flag_quit ) { return -3; }