bmacho / bughouse-viewer

a website where you can review and share your chess.com matches
https://bmacho.github.io/bughouse-viewer/view.html
5 stars 1 forks source link

bug in bug.js #3

Closed bmacho closed 3 years ago

bmacho commented 3 years ago

When the f7 g7 squares are clean, white queen attacks the black king on g6, black drops a pawn on f7 to block, and then later black castles kingside, then we can view the game only once, if one goes through the game, goes back to the beginning, then tries to view the game again, it stops before the pawn dropping.

This is a bug in Fermy's bug.js, it affects https://bughousedb.com/ and https://www.bughouse-db.org/ as well.

How to reproduce it: load a game with the PGN

1A. e2e3 1a. f7f6 
2A. Qd1e2 2a. Ng8h6 
3A. Qe2d3 3a. g7g6 
4A. Qd3g6 4a. P@f7
5A. Qg6d3 5a. Bf8g7
6A. b2b3 6a. o-o  
7A. b3b4 7a. b7b6  
* 

click the jump to the end button, then the jump to the beginning button, then the jump to the end button again. It stops before the pawn drop on f7.

I am not fully aware the conditions when this bug happens, but in some variations, it does not, e.g. if Bishop attacks the king, or the g7 pawn is still on its square when the Queen attacks, or when black does not castle kingside later on the game.

g7 pawn is still there:

1A. e2e3 1a. f7f6 
2A. Qd1e2 2a. Ng8h6 
3A. Qe2d3 3a. e7e6 
4A. Qd3g6 4a. P@f7
5A. Qg6d3 5a. Bf8a3
6A. b2b3 6a. o-o  
7A. b3b4 7a. b7b6  
* 

without castle:

1A. e2e3 1a. f7f6 
2A. Qd1e2 2a. Ng8h6 
3A. Qe2d3 3a. g7g6 
4A. Qd3g6 4a. P@f7
5A. Qg6d3 5a. Bf8g7
6A. b2b3 6a. P@c5  
7A. b3b4 7a. b7b6  
bmacho commented 3 years ago

Not an issue, as we switched to SKAcz's hy.js