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

Generate all (legal) moves #33

Closed justbyitself closed 3 weeks ago

justbyitself commented 3 weeks ago

You can generate all legal moves from an specific square, for example: game.board.generate_moves('e2')

But you don't have a method in order to generate all legal moves (from any square). Of course you can calculate it using generate_moves method (see https://gist.github.com/justbyitself/4ab2265358dcdafffcc37d45f686a8d4 as example) but it would be nice if this library would do that work for you.

Another chess libraries (coded in other languages) have this feature, for example:

Thank you again.

pioz commented 3 weeks ago

I have add the new method board.generate_all_moves.

You can start using this method from v0.4.0.

justbyitself commented 3 weeks ago

Thank you!