Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double pawn moves are considered captures by Move.is_capture() #26

Open
SloPro opened this issue Apr 19, 2023 · 2 comments
Open

Double pawn moves are considered captures by Move.is_capture() #26

SloPro opened this issue Apr 19, 2023 · 2 comments

Comments

@SloPro
Copy link

SloPro commented Apr 19, 2023

#include <iostream>
#include "position.h"
using namespace std;

int main()
{
    initialise_all_databases();
    zobrist::initialise_zobrist_keys();

    Position pos;
    Position::set(DEFAULT_FEN, pos);
    cout << pos << endl;

    MoveList<WHITE> moves(pos);
    for (const auto &m : moves)
    {
        cout << "     " << m << " iscapture: " << m.is_capture() << " flags: " << m.flags() << endl;
    }

    return 0;
}

Generates the following:

...
     f2f3 iscapture: 0 flags: 0
     g2g3 iscapture: 0 flags: 0
     h2h3 iscapture: 0 flags: 0
     a2a4 iscapture: 1 flags: 1
     b2b4 iscapture: 1 flags: 1
     c2c4 iscapture: 1 flags: 1
     d2d4 iscapture: 1 flags: 1
     e2e4 iscapture: 1 flags: 1
     f2f4 iscapture: 1 flags: 1
     g2g4 iscapture: 1 flags: 1
     h2h4 iscapture: 1 flags: 1

As you can see, move.is_capture() returns true for double pawn moves despite the flag being correctly set to MoveFlags::DOUBLE_PUSH (= 1).

@Thibor
Copy link

Thibor commented Apr 20, 2023

in function is_capture need change CAPTURES to CAPTURE and this will be fixed

@Thibor
Copy link

Thibor commented Apr 20, 2023

i found next errror in constructor Move(const std::string& move) , does not support promotion like a7a8n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants