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

About in_checkmate() with Ka7 or Ka8 #168

Closed
UserFro opened this Issue Dec 19, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@UserFro

UserFro commented Dec 19, 2017

Hello, why this is a true:

var game = new Chess ('k7/2Q5/8/8/8/8/8/8 w - - 0 1');
alert (game.in_checkmate()); //true

but for any similar position returned value is false:

var game = new Chess ('7k/5Q2/8/8/8/8/8/8 w - - 0 1');
alert (game.in_checkmate()); //false

Only for positions with king on a7 or a8 (and without opposite king on the board) the function says "true" and i can't get moves() array for any piece.

@jhlywa

This comment has been minimized.

Show comment
Hide comment
@jhlywa

jhlywa Dec 20, 2017

Owner

It's not a valid position, you need a white king on the board.

Owner

jhlywa commented Dec 20, 2017

It's not a valid position, you need a white king on the board.

@jhlywa jhlywa closed this Dec 20, 2017

@UserFro

This comment has been minimized.

Show comment
Hide comment
@UserFro

UserFro Dec 20, 2017

Of course. But there are different ways to use the API. I am confused by the difference of the function logic. More than expected, there is always a "true" or always a "false" for the same positions

UserFro commented Dec 20, 2017

Of course. But there are different ways to use the API. I am confused by the difference of the function logic. More than expected, there is always a "true" or always a "false" for the same positions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment