Commit graph

13 commits

Author SHA1 Message Date
0d8653894a An attempt at making unit structs for Color and piece Shape
My idea was to implement traits on Piece that return sight lines, etc. This has
turned out to be much more complex than I thought it would be. Ultimately, I
don't think it's worth the effort.
2024-01-14 10:23:35 -08:00
7c80c61690 [board] Implement a position! macro for creating Positions
For example:

```
let position = position![
    White King on E4,
    Black Rook on E8,
];
```
2024-01-12 22:30:00 -08:00
94ab64d277 [board] Add a piece! macro
This macro implements a tiny DSL for creating Pieces and PlacedPieces.

"White King" → Piece::new(Color::White, Shape::King)
"White King on E4" → PlacedPiece::new(Piece::new(Color::White, Shape::King), Square::E4)
2024-01-12 22:26:13 -08:00
14db74f212 Remove tests module 2024-01-06 16:45:13 -08:00
2105004dc2 Reimplement Square as an enum; implement Rank and File enums
Replace the Square struct with an enum. This implementation is based on this one:

https://github.com/analog-hors/magic-bitboards-demo/blob/main/types/src/square.rs

This reduces a lot of code needed to construct squares, ranks, and files.
2024-01-06 16:08:34 -08:00
72dabfe73f [board] A couple small changes to support the explorer crate
- DiagramFormatter::new
- Make board::position public
2023-12-28 15:11:57 -07:00
5039d657ae [board] Some test helpers that produce Squares from algebraic notiation and assert their validity 2023-12-28 12:08:44 -07:00
dda4cd8a5a [board] Add a MoveGenerator struct 2023-12-27 10:02:37 -07:00
ff59799add [board] Move neighbor::Direction → square::Direction 2023-12-27 08:01:44 -07:00
8d06cbf0f8 [board] Make the piece module public and remove the crate-level export of Color and Piece 2023-12-26 21:36:38 -07:00
758a3d95fc [board] Reorganize bitboard and position modules and export some symbols from the crate
Move position.rs to the position module and create a mod.rs.
Do the same for bitboard.rs in the bitboard modules.
Export Color, Piece, Position, and Square and use crate::Thing directly instead of referring to the symbol in the nested modules.
2023-12-26 11:25:27 -07:00
9bcd0b2148 [board] Add neighbor and piece modules
Add a Direction enum in the neighbor module
Add Color and PieceShape enums, and a Piece struct to the piece module
2023-12-23 09:18:07 -07:00
d776bd18e2 [board] Move bitboard lib to "board" 2023-12-20 11:45:55 -08:00
Renamed from bitboard/src/lib.rs (Browse further)