1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! # ruchess
//!
//! A chess library built around [`Bitboard`](crate::bitboard::Bitboard)s and a
//! persistent, functional API. Every state-changing operation — placing a
//! piece, playing a move, updating castling rights — returns a new value
//! instead of mutating in place.
//!
//! ## At a glance
//!
//! ```
//! use ruchess::game::Game;
//! use ruchess::square;
//! use ruchess::uci::Uci;
//!
//! // Play 1.e4 from the standard starting position.
//! let game = Game::new();
//! let after_e4 = game.mve(&Uci { orig: square::E2, dest: square::E4, promotion: None }).unwrap();
//! assert!(after_e4.position().board().is_occupied(square::E4));
//! ```
//!
//! ## Module map
//!
//! - [`bitboard`] — 64-bit board representation and bitwise operations.
//! - [`square`], [`rank`], [`file`] — coordinate primitives.
//! - [`color`], [`role`], [`piece`], [`side`] — piece and side identifiers.
//! - [`board`] — piece placement, attack detection, and queries.
//! - [`attacks`], [`magic`] — precomputed attack tables and magic bitboards.
//! - [`mve`], [`uci`] — move representation and UCI parsing.
//! - [`castles`], [`unmoved_rooks`] — castling rights and rook tracking.
//! - [`halfmoveclock`], [`ply`] — clocks for the fifty-move rule and side to move.
//! - [`hash`] — Zobrist hashing and repetition trails.
//! - [`history`] — per-position history (last move, castles, clock, hashes).
//! - [`position`] — a complete game state with legal-move generation.
//! - [`outcome`] — terminal results (win, draw, draw reason).
//! - [`game`] — high-level wrapper that tracks turns and outcomes.