Пример #1
0
int main(int argc, char * argv[]) {

   // init

   util_init();
   my_random_init(); // for opening book

   printf("Toga II 1.2.1a UCI based on Fruit 2.1 by Thomas Gaksch and Fabien Letouzey. Settings by Dieter Eberle\n");

   // early initialisation (the rest is done after UCI options are parsed in protocol.cpp)

   option_init();

   square_init();
   piece_init();
   pawn_init_bit();
   value_init();
   vector_init();
   attack_init();
   move_do_init();

   random_init();
   hash_init();

   trans_init(Trans);
   book_init();

   // loop

   loop();

   return EXIT_SUCCESS;
}
Пример #2
0
int main(int argc, char *argv[]) {

	// init

	util_init();
	my_random_init(); // for opening book

	printf(
		"Gambit Fruit based on Fruit 2.1 and Toga by Ryan Benitez, Thomas Gaksch and Fabien Letouzey\nEdit by Evgeniy Zheltonozhskiy\n");

	// early initialisation (the rest is done after UCI options are parsed in protocol.cpp)

	option_init();

	square_init();
	piece_init();
	pawn_init_bit();
	value_init();
	vector_init();
	attack_init();
	move_do_init();

	random_init();
	hash_init();

	trans_init(Trans);
	book_init();

	// loop
	loop();

	return EXIT_SUCCESS;
}
Пример #3
0
TEngine::TEngine(AnsiString FileName)
{
   util_init();
   my_random_init();
   square_init();
   piece_init();
   pawn_init_bit();
   value_init();
   vector_init();
   attack_init();
   move_do_init();
   random_init();
   hash_init();

   Reversed = true;
   board_from_fen(&StartBoard,StartFen);
   board_from_fen(&Board,StartFen);
   GameStarted = false;

   StateNewGame = false;
   LastCommitMove[0] = 0;
   Process = new TProcess(FileName);
   Process->Send("uci");
   char buf[10000];
   do {
      Sleep(10);
      if (Process->Get(buf)) {
        char *next_line = buf;
        while (true) {
           char *cur_line = next_line;
           if (cur_line[0] == 0)
             break;
           char *end = strstr(cur_line,"\r\n");
           end[0] = 0;
           end[1] = 0;
           next_line = end + 2;
           char *cur_word;
           while (cur_line) {
             cur_word = get_cur_word_str(&cur_line);
             int pos;
             if (string_equal(cur_word,"id")) {
               cur_word = get_cur_word_str(&cur_line);
               if (string_equal(cur_word,"name")) {
                   AnsiString EngineName = cur_line;
                   MainForm->lbEngineName->Caption = EngineName;
               }
             }
             if (string_equal(cur_word,"uciok")) {
                if (MainForm->MultiPV > 1) {
                   Process->Send("setoption name MultiPV value " + IntToStr(MainForm->MultiPV));
                   Sleep(100);
                   Process->Get(buf);
                }
                Process->Send("setoption name Hash value " + IntToStr(MainForm->HashSize));
                return;
             }
           }
        }
      }
   }
   while (true);
}