Beispiel #1
0
void test_speed() {
    const char input[] = "position fen r2q1rk1/pP1p2pp/Q4n2/bbp1p3/Np6/1B3NBn/pPPP1PPP/R3K2R b KQ - 0 1";
    puts(input);
    Chess chess;
    chess.start_game();
    chess.table->setboard(input);
    chess.max_time = 0;
    chess.gui_depth = 2;
    chess.make_move();
}
Beispiel #2
0
void test_eval_depth_2() {
    const char input[] = "position fen 4k2n/8/6p1/6P1/6p1/6P1/8/4K2N w - - 0 1 ";
    puts(input);
    Chess chess;
    chess.start_game();
    chess.table->setboard(input);
    chess.max_time = 0;
    chess.gui_depth = 5;
    chess.default_seldepth = 0;
    chess.make_move();
}
Beispiel #3
0
void test_move_h2h4() {
    Chess chess;
    chess.start_game();
    const char input[] = "position startpos moves h2h4";
    chess.uci->position_received(input);
    // chess.max_time = 300000 / 40;
    chess.max_time = 0;
    chess.gui_depth = 4;
    chess.make_move();
    assert(strcmp(Util::move2str(chess.best_move), "h7h5 ") == 0);
    assert(chess.nodes == 34298);
    assert(7000 < chess.table->eval->hash->hash_nodes);
}
Beispiel #4
0
void test_mate_in_2() {
    const char input[] =
        "position fen 2bqkbn1/2pppp2/np2N3/r3P1p1/p2N2B1/5Q2/PPPPKPP1/RNB2r2 w "
        "KQkq - 0 1";
    puts(input);
    Chess chess;
    chess.start_game();
    chess.table->setboard(input);
    chess.max_time = 0;
    chess.gui_depth = 5;
    chess.default_seldepth = 0;
    chess.make_move();
}
Beispiel #5
0
void test_bratko_kopec_12() {
    const char input[] =
        "position fen r3r1k1/ppqb1ppp/8/4p1NQ/8/2P5/PP3PPP/R3R1K1 b - "
        "- 0 1 bm Bf5; id BK.12;";
    puts(input);
    Chess chess;
    chess.start_game();
    chess.table->setboard(input);
    chess.max_time = 0;
    chess.gui_depth = 2;
    chess.make_move();
    assert(strcmp(Util::move2str(chess.best_move), "d7f5 ") == 0);
}
Beispiel #6
0
void test_bratko_kopec_10() {
    const char input[] = "position fen "
                   "3rr1k1/pp3pp1/1qn2np1/8/3p4/PP1R1P2/2P1NQPP/R1B3K1 b - - 0 "
                   "1 bm Ne5; id BK.10;";
    puts(input);
    Chess chess;
    chess.start_game();
    chess.table->setboard(input);
    chess.max_time = 0;
    chess.gui_depth = 5;
    chess.make_move();
    assert(strcmp(Util::move2str(chess.best_move), "c6e5 ") == 0);
}
Beispiel #7
0
void test_bratko_kopec_2() {
    const char input[] =
        "position fen 3r1k2/4npp1/1ppr3p/p6P/P2PPPP1/1NR5/5K2/2R5 w - "
        "- 0 1 bm d5; id BK.02;";
    puts(input);
    Chess chess;
    chess.sort_alfarray = true;
    chess.start_game();
    chess.table->setboard(input);
    chess.max_time = 0;
    chess.gui_depth = 5;
    chess.make_move();
    assert(strcmp(Util::move2str(chess.best_move), "d4d5 ") == 0);
}
Beispiel #8
0
void test_bratko_kopec_1b() {
    const char input[] =
        "position fen 1k1r4/pp1b1R2/3q2pp/4p3/2B5/4Q3/PPP2B2/2K5 b - "
        "- 0 1 bm Qd1+; id BK.01;";
    puts(input);
    Chess chess;
    chess.start_game();
    chess.table->setboard(input);
    chess.max_time = 0;
    chess.gui_depth = 1;
    chess.make_move();
    assert(strcmp(Util::move2str(chess.best_move), "d6d1 ") == 0);
    assert(chess.mate_score == 21995);
    assert(chess.root_moves[0].value == 21995);
    assert(chess.depth == 1);
}
Beispiel #9
0
void test_bratko_kopec_1() {
    // 2018.01.23. linode, c++: info depth 5 seldepth 5 time 16964 nodes 1865184 nps 109949
    // 2018.01.23. core i5 c++: info depth 5 seldepth 5 time 8952 nodes 1865184 nps 208353
    const char input[] =
        "position fen 1k1r4/pp1b1R2/3q2pp/4p3/2B5/4Q3/PPP2B2/2K5 b - "
        "- 0 1 bm Qd1+; id BK.01;";
    puts(input);
    Chess chess;
    chess.sort_alfarray = true;
    chess.start_game();
    chess.table->setboard(input);
    chess.max_time = 0;
    chess.gui_depth = 5;
    chess.default_seldepth = 0;
    chess.break_if_mate_found = false; // remove
    chess.make_move();
    assert(strcmp(Util::move2str(chess.best_move), "d6d1 ") == 0);
    assert(chess.mate_score == 21995);
    assert(chess.root_moves[0].value == 21995);
}