pioz / chess

A fast chess library that use bitboards to play chess with Ruby
GNU Lesser General Public License v3.0
59 stars 17 forks source link

Wrong generated move #32

Closed justbyitself closed 3 weeks ago

justbyitself commented 3 weeks ago

I think I've found another bug.

When my board is like this

8 . n b . k b n r 
7 r . p . . p p . 
6 . . . p . q . . 
5 p p . . N P . p 
4 . . . . . . . P 
3 . . P P . . . . 
2 P P . . P . P . 
1 R . B Q K B N R 
  a b c d e f g h

... and I generate moves from a5 game.board.generate_moves('a5')

...then, I get: ["axh3ep", "a4"] and I expect: ["a4"]

A gist in order to reproduce this issue: https://gist.github.com/justbyitself/d7bc805abf8f575754fb68cacf3e153e

Note: I've found this (possible) bug and https://github.com/pioz/chess/issues/31, fighting two pioz/chess ramdon-moves engine (with cutechess-cli, via UCI protocol). See: https://gist.github.com/justbyitself/4ab2265358dcdafffcc37d45f686a8d4

pioz commented 3 weeks ago

Fixed in https://github.com/pioz/chess/commit/152ee7771aa8c535e24733116eeb3095f8c2513b .

Let me know if the issue is solved with release v0.3.6. Thanks for your precious support!

justbyitself commented 3 weeks ago

Great! It works! Thank you four your support.