From f1116fdbbc5f4a832141ff26157f34851d6e98d3 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 17 Aug 2025 20:46:49 -0400 Subject: [PATCH] Add FEN string to readme --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 848afcb..cefcc64 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,30 @@ Build a clean, fast chess engine in C that starts from a FEN string and produces ## Approach - **Correctness-first engine:** `FEN → board → legal movegen → PERFT` +## FEN (Forsyth–Edwards Notation) + +FEN is a single line string that describes a chess position. Format: + + + +- **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 Black’s 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**.