1
0
Fork 0

update docs

This commit is contained in:
Paul-Nicolas Madelaine 2025-11-18 06:49:33 +01:00
parent 671ff331d3
commit b45952b6b7
5 changed files with 47 additions and 43 deletions

View file

@ -5,19 +5,18 @@
//!
//! ## Overview
//!
//! The most important type in eschac is [`Position`](position::Position), it represents a chess
//! position from which legal moves are generated. [`Position::new`](position::Position::new)
//! returns the starting position of a chess game, and arbitrary positions can be built using the
//! [`Setup`](setup::Setup) type, but they must be validated and converted to a
//! [`Position`](position::Position) to generate moves as eschac does not handle certain illegal --
//! as in unreachable in a normal game -- positions (see
//! [`IllegalPositionReason`](setup::IllegalPositionReason) to know more). Legal moves are then
//! generated using the [`Position::legal_moves`](position::Position::legal_moves) method or
//! obtained from chess notation like [`UciMove`](uci::UciMove) or [`San`](san::San). Moves are
//! represented with the [`Move<'l>`](moves::Move) type, which holds a reference to the origin
//! position (hence the lifetime), this ensures the move is played on the correct position.
//! Finally, moves are played using the [`Move::make`](moves::Move::make) method which returns a new
//! [`Position`](position::Position), and on it goes.
//! In eschac, a chess position is represented with the [`Position`](position::Position) type.
//! [`Position::new`](position::Position::new) returns the starting position of a chess game, and
//! arbitrary positions can be built using the [`Setup`](setup::Setup) type. This type must be
//! validated and converted to a [`Position`](position::Position) to generate moves as eschac does
//! not handle certain unreachable positions (see
//! [`Setup::into_position`](setup::Setup::into_position) to know more). Legal moves are generated
//! using the [`Position::legal_moves`](position::Position::legal_moves) method or obtained from
//! chess notation like [`UciMove`](uci::UciMove) or [`San`](san::San). Moves are represented with
//! the [`Move<'l>`](moves::Move) type, which holds a reference to the origin position (this
//! ensures the move is played on the correct position). Finally, moves are played with
//! [`Move::make`](moves::Move::make) which returns a new [`Position`](position::Position), and on
//! it goes.
//!
//! ## Example
//!