Menu

#30 Move improperly marked as giving check

ictk v0.2.0
open
nobody
5
2005-05-09
2005-05-09
No

A move can be improperly marked as giving check. Here's
a game of Morphy's in pgn:

1.e4 e5 2.Nf3 d6 3.d4 Bg4 4.dxe5 Bxf3 5.Qxf3 dxe5 6.Bc4
Nf6 7.Qb3 Qe7
8.Nc3 c6 9.Bg5 b5 10.Nxb5 cxb5 11.Bxb5+ Nbd7 12.O-O-O
Rd8 13.Rxd7
Rxd7 14.Rd1 Qe6 15.Bxd7+ Nxd7 16.Qb8+ Nxb8 17.Rd8+ 1-0

Here's the output from SimplePGNDemo using ictk-0.2.0:

1.e4 e5 2.Nf3 d6 3.d4 Bg4 4.dxe5 Bxf3 5.Qxf3 dxe5 6.Bc4
Nf6 7.Qb3 Qe7 8.Nc3 c6
9.Bg5 b5 10.Nxb5 cxb5 11.Bxb5+ Nbd7 12.O-O-O Rd8
13.Rxd7+ Rxd7 14.Rd1 Qe6
15.Bxd7+ Nxd7 16.Qb8+ Nxb8 17.Rd8# 1-0

See move 13 white. Rxd7 doesn't give check, but in the
ouput note: 'Rxd7+'.

Seems the problem is in ChessMove.execute(). Around
line 387 the captured piece is taken off the board.
Then at line 427 there's a call to
board.isDestUniqueForClass. This ends up calling
ChessBoard.genLegalDests where at line 277 we find:

lastMove.setCheck(true);

I moved the call to isDestUniqueForClass above the
casualty removal code and it seems to work, but I
haven't looked closer. Probably an easy fix for the author.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB