Files
chess/README.md
Josh 54537e404b
All checks were successful
Python tests (make) / test (push) Successful in 10s
Add FEN string to readme (#14)
Reviewed-on: #14
Co-authored-by: Josh <josh@joshuaschuett.com>
Co-committed-by: Josh <josh@joshuaschuett.com>
2025-08-18 00:48:35 +00:00

44 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Chess Engine in C — Project Goal
Build a clean, fast chess engine in C that starts from a FEN string and produces fully legal moves, verified via **PERFT** for correctness and speed.
## Approach
- **Correctness-first engine:** `FEN → board → legal movegen → PERFT`
## FEN (ForsythEdwards Notation)
FEN is a single line string that describes a chess position. Format:
<pieces> <side> <castling> <en-passant> <halfmove> <fullmove>
- **pieces**: 8 ranks (8→1) separated by `/`; letters for pieces (`PNBRQK`/`pnbrqk`), digits for empty squares.
- **side**: `w` (White) or `b` (Black) to move.
- **castling**: any of `KQkq` or `-` if none.
- **en-passant**: target square after a two-step pawn move, or `-`.
- **halfmove**: moves since last pawn move/capture (50-move rule).
- **fullmove**: move number (starts at 1, increments after Blacks move).
**Example (starting position)**
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
- pieces: starting layout
- side: `w` (White to move)
- castling: `KQkq` (both sides can castle both ways)
- en-passant: `-`
- halfmove: `0`
- fullmove: `1`
## Future Work
- Incorporate algorithms and evaluation methods for chess positions to enable an **AI player**.
- Build an API to facilitate chess games with the AI player over the web.
- Starting with a commandline client.
- Later building a web based client.
## Chess Engine Programming & Information
- **Chess Programming Wiki (CPW):** <https://www.chessprogramming.org/>
- **PERFT (definition & methodology):** <https://www.chessprogramming.org/Perft>
- **PERFT Results & test positions:** <https://www.chessprogramming.org/Perft_Results>
- **FEN reference:** <https://www.chessprogramming.org/Forsyth-Edwards_Notation>
- **Bitboards** <https://www.chessprogramming.org/Bitboards>