crabchess 0.1.15

A simple Chess API
Documentation
//! Tools for analyzing chess positions and building chess software in Rust.
//!
//! `crabchess` is a 100% Rust Chess API with no `unsafe` code that enables you to build 
//! chess-related software tools. `crabchess` can import and export PGNs (Portable Game Notation)
//! and FENs (Forsyth-Edwards Notation), determine the status of a game of chess, identify illegal
//! move attempts, determine a game's ECO opening, track players' time remaining, and much more.
//! `crabchess` works not only with standard chess but also random board configurations like 
//! Fischer random chess (Chess960).
//!
//! ## Example
//!
//! Most of the core functionality is exposed through the `ChessPosition` struct, which represents
//! a game of chess. The `ChessPosition` struct can be mutated and consulted as a game progresses.
//!
//! ```
//! use crabchess::prelude::*;
//! 
//! // Create board with default (Staunton) starting position.
//! let mut position = ChessPosition::new();
//! 
//! // Apply moves in SAN format.
//! position
//!     .apply_sans("e4 e6 Nf3 g6 d4 Bg7 e5 Ne7 g4".split(' '))
//!     .unwrap();
//! 
//! // Or, use the `Move` enum.
//! position
//!     .apply_move(Move::Castle {
//!         side: Side::Kingside,
//!         color: Color::Black,
//!         timer_update: None,
//!     })
//!     .unwrap();
//! 
//! assert_eq!(
//!     position.fen(),
//!     "rnbq1rk1/ppppnpbp/4p1p1/4P3/3P2P1/5N2/PPP2P1P/RNBQKB1R w KQ - 1 6"
//! );
//! 
//! position
//!     .apply_move(Move::Standard {
//!         initial_square: sq!(F3),
//!         piece_type: Type::Knight,
//!         piece_color: Color::White,
//!         final_square: sq!(G5),
//!         is_capture: false,
//!         timer_update: None,
//!     })
//!     .unwrap();
//! ```

#![warn(clippy::all, clippy::pedantic, clippy::nursery)]

use mimalloc::MiMalloc;

#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;

pub mod board;
mod counter;
mod error;
mod macros;
pub mod openings;
pub mod pgn;
pub mod pieces;
pub mod positions;
pub mod prelude;
pub mod squares;
#[cfg(feature = "termcolor")]
mod termcolor;