amogh-dambal / diogenes-v2

V2 implementation of the Diogenes chess engine. This time in Rust.
0 stars 0 forks source link

Add basic move generation algorithms #6

Open amogh-dambal opened 8 months ago

amogh-dambal commented 8 months ago

The next fundamental step of building out our engine is to build a efficient, correct move generation algorithm. Generation of pseudo-legal or legal moves are both options, but generating legal moves ends up being more efficient since pseudo-legal move generators have to check for legality after generation anyway.

At a high level, we need to watch out for:

  1. King attacks
  2. Check evasions
  3. Pinned pieces

References See https://peterellisjones.com/posts/generating-legal-chess-moves-efficiently/ for notes on how to do this.

amogh-dambal commented 5 months ago

Some test FEN strings as well as a perft output for testing purposes: https://gist.github.com/peterellisjones/8c46c28141c162d1d8a0f0badbc9cff9