-/*
- BUG LIST
-
- - detection of repetitions can be wrong due to collision of hash keys and
- limitation of history table size.
-
- - detection of mates fails if all of pseudo-legal evasions are perpetual
- checks. Father more, inferior evasions, such as unpromotion of
- bishop, rook, and lance at 8th rank, are not counted for the mate
- detection.
-
- - detection of perpetual checks fails if one of those inferior
- evasions makes a position that occurred four times.
-*/
-/*
- TODO:
- - idirec && is_pinned_on_black_king();
- - aifile and airank
- - incheck at quies
- - max legal moves
- - tactical macro
- - out_warning( "A node returns a value lower than mate." ); is obsolate.
- - do_mate in hash
- - pv store to hash
- - no threat
- - use IsDiscover macro
- - change hash_store_pv()
- - dek.c is obsolate.
- - limit time ? ? num
- - hash.bin
- - SHARE to all transition table
- */
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static int main_child( tree_t * restrict ptree );
-int CONV_CDECL
-#if defined(CSASHOGI)
+int
+#if defined(CSASHOGI) || defined(USI)
main( int argc, char *argv[] )
#else
main()
#endif
#if defined(CSASHOGI) && defined(_WIN32)
- FreeConsole();
if ( argc != 2 || strcmp( argv[1], "csa_shogi" ) )
{
MessageBox( NULL,
}
#endif
+#if defined(USI)
+ if ( argc == 2 && ! strcmp( argv[1], "usi" ) ) { usi_mode = usi_on; }
+ else { usi_mode = usi_off; }
+#endif
+
if ( ini( ptree ) < 0 )
{
out_error( "%s", str_error );
if ( iret == -1 )
{
out_error( "%s", str_error );
- ShutdownClient;
+ ShutdownAll();
break;
}
else if ( iret == -2 )
{
out_warning( "%s", str_error );
- ShutdownClient;
+ ShutdownAll();
continue;
}
else if ( iret == -3 ) { break; }
{
int iret;
-#if defined(DEKUNOBOU)
- if ( dek_ngame && ( game_status & mask_game_end ) )
- {
- TlpEnd();
- if ( dek_next_game( ptree ) < 0 )
- {
- out_error( "%s", str_error );
- return -3;
- }
- }
-#endif
-
/* ponder a move */
ponder_move = 0;
iret = ponder( ptree );