glinscott / Garbochess-JS

A strong javascript chess engine using WebWorkers
http://forwardcoding.com/projects/ajaxchess/chess.html
Other
313 stars 101 forks source link

dealing with en-passant? #3

Closed casaschi closed 13 years ago

casaschi commented 13 years ago

I get a javascript error if I try analyzing the following position on http://forwardcoding.com/projects/ajaxchess/chess.html

8/1r1n3k/1p6/2pP4/1R1N4/8/7P/7K w - c6 0 2

If I set this up in my chrome extension, garbochess fails to see the obvious winning move dxc6

casaschi commented 13 years ago

More on the inability to solve the position above.It looks like garbochess is unable to consider an en passent move as the first move of a sequence.

Look at this game:

[FEN "8/1rpn3k/1p6/3P4/1RPp4/5N2/7P/7K w - - 0 1"]

1.Nxd4 c5

At ply zero (before Nxd4), garbochess finds Nxd4 as the best move. After that it does not consider c5 as the best move, evidently considering dxc6 as the refutation. But when analyzing the position after c5, garbochess fails to find the winning dxc6.

casaschi commented 13 years ago

sorry... closed by mistake... still open...

glinscott commented 13 years ago

Fixed, it was a bug with initializing E.P. Thanks for catching!

casaschi commented 13 years ago

you got it! it was easy for me to spot, I was looking at a game where at some point an en-passant move was the only good move for White and the evaluation graph stays at +1 for White all the time but when the ep move is the best it suddenly shows a negative value... I looked for blunders from the players but nothing...

Thanks for fixing it so quickly!