StefanSalewski / rust-chess

Port of salewski-chess from Nim to Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

no ep possible

tissatussa opened this issue · comments

it happened with the current rust-chess version .. Black (rust-chess) just played e7-e5 and White should be able to capture this pawn by ep, but it's an "invalid move" :

no-ep-possible

OK, I hope that I have all your reported issues fixed in the Rust version. Have done only a short minimal test yet.

For this setup

pub fn new_game() -> Game {
...
    if true {
        g.board = [0; 64];

        set_board(&mut g, W_ROOK, BA, B1);
        set_board(&mut g, W_ROOK, BH, B1);
        set_board(&mut g, W_BISHOP, BB, B2);
        set_board(&mut g, W_QUEEN, BC, B2);
        set_board(&mut g, W_KING, BD, B2);
        set_board(&mut g, W_PAWN, BF, B2);
        set_board(&mut g, W_PAWN, BG, B2);
        set_board(&mut g, W_PAWN, BH, B2);
        set_board(&mut g, W_PAWN, BA, B3);
        set_board(&mut g, W_BISHOP, BD, B3);
        set_board(&mut g, W_PAWN, BE, B3);
        set_board(&mut g, W_KNIGHT, BF, B3);
        set_board(&mut g, B_PAWN, BG, B4);
        set_board(&mut g, W_PAWN, BC, B5);
        set_board(&mut g, W_PAWN, BD, B4); // !!!
        set_board(&mut g, B_PAWN, BE, B7); // !!!
        set_board(&mut g, B_PAWN, BF, B5);
        set_board(&mut g, B_KNIGHT, BC, B6);
        set_board(&mut g, B_QUEEN, BF, B6);
        set_board(&mut g, B_ROOK, BG, B6);
        set_board(&mut g, B_PAWN, BA, B7);
        set_board(&mut g, B_PAWN, BB, B7);
        set_board(&mut g, B_PAWN, BC, B7);
        set_board(&mut g, B_PAWN, BH, B7);
        set_board(&mut g, B_ROOK, BA, B8);
        set_board(&mut g, B_BISHOP, BC, B8);
        set_board(&mut g, B_KING, BE, B8);
        set_board(&mut g, B_BISHOP, BF, B8);
    }
    g
}

after d4d5 engine replies e7e5 and we can do ep capture. If we setup a position directly with black pawn at e5 white can not do ep capture, as it is not clear that last move was e7e5.

I have also removed the GTK features, as we do not need them, and we are now using latest gtk-rs 0.8.1. That should be OK as 0.8.1 is directly fetched by Cargo in the build process.

Best regards,

Stefan Salewski