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

Pawn does not promote when reaching the other end #15

Open
Nickvanhurck opened this issue Mar 12, 2021 · 2 comments
Open

Pawn does not promote when reaching the other end #15

Nickvanhurck opened this issue Mar 12, 2021 · 2 comments

Comments

@Nickvanhurck
Copy link

When the pawn reaches the other end of the board the pawn does not promote.

@CZSeas
Copy link

CZSeas commented May 10, 2021

if (player == WHITE and _to[0] == 7) or (player == BLACK and _to[0] == 0):

should be changed to

if (player == WHITE and _to[0] == 0) or (player == BLACK and _to[0] == 7):

@scoldi
Copy link

scoldi commented Jan 2, 2022

It should be noted that a pawn can promote to any of the pieces (except king or another pawn, obviously), not just a queen. So the options are queen, rook, knight or bishop.

The current implementations of both v1 and v2 seem to only support promotion to a queen:
new_state[_to[0], _to[1]] = QUEEN_ID * self.player_to_int(player)

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

3 participants