Commit graph

6 commits

Author SHA1 Message Date
3b3062108a [board] Implement fmt::Display on Square
Prints the square in algebraic notation
2024-01-05 18:29:01 -08:00
b95c34f51e [board] Implement KnightMoveGenerator
Use the generated knight_moves BitBoards from bitboard::MoveLibrary to generate knight moves.

This commit doesn't yet implement computing bitboards for knight moves.
2024-01-01 09:37:44 -08:00
4a54d8b877 [board] Implement KingMoveGenerator
Generate moves for kings.

This struct is trying out a different approach to iterators where the type
itself isn't one, but it has an iter() method that returns an iterator over all
the move lists.

This struct also builds all the moves up front, in new() before the new instance
is returned.
2023-12-31 16:35:34 -08:00
af36b75df7 [board] Implement a pawn move generator
Holy heck I went on a *journey* here. Ultimately, I needed to implement my own
index-based iterator instead of using the Vec's Iterator.

This type establishes some patterns I want to carry forward to other move
generators.

1. The use of a Parameters struct to fully parameterize the move generation
   per-color. That lets these types only need a single color-based branch
2. A list of move lists, one list for each of captures, promotions, and quiet
   moves.
3. An index-based move iterator.
4. Separate impl for generating bitboard representations of these moves

Additional changes:

- Implement BitBoard::from_square()
- Implement a Square::e5() for tests

This class doesn't implement en passant yet. It also doesn't yet have tests for
the bitboard stuff.
2023-12-31 11:44:47 -08:00
852b7a848f [board] Implement PawnMoveGenerator
It generates pawn moves with bitboard bit operations!
2023-12-29 09:03:02 -08:00
5039d657ae [board] Some test helpers that produce Squares from algebraic notiation and assert their validity 2023-12-28 12:08:44 -07:00