chess/
lib.rs

1#![doc(html_root_url = "https://jordanbray.github.io/chess/")]
2//! # Rust Chess Library
3//! This is a chess move generation library for rust.  It is designed to be fast, so that it can be
4//! used in a chess engine or UI without performance issues.
5//!
6//! ## Example
7//!
8//! This generates all the moves on the starting chess position, and checks that the number of
9//! moves is correct.
10//!
11//! ```
12//!
13//! use chess::{Board, MoveGen};
14//!
15//! let board = Board::default();
16//! let movegen = MoveGen::new_legal(&board);
17//! assert_eq!(movegen.len(), 20);
18//! ```
19//!
20
21mod board;
22pub use crate::board::*;
23
24mod bitboard;
25pub use crate::bitboard::{BitBoard, EMPTY};
26
27mod cache_table;
28pub use crate::cache_table::*;
29
30mod castle_rights;
31pub use crate::castle_rights::*;
32
33mod chess_move;
34pub use crate::chess_move::*;
35
36mod color;
37pub use crate::color::*;
38
39mod construct;
40pub use crate::construct::*;
41
42mod file;
43pub use crate::file::*;
44
45mod magic;
46pub use crate::magic::{
47    between, get_adjacent_files, get_bishop_moves, get_bishop_rays, get_file, get_king_moves,
48    get_knight_moves, get_pawn_attacks, get_pawn_moves, get_pawn_quiets, get_rank, get_rook_moves,
49    get_rook_rays, line, EDGES,
50};
51
52#[cfg(target_feature = "bmi2")]
53pub use crate::magic::{get_bishop_moves_bmi, get_rook_moves_bmi};
54
55mod piece;
56pub use crate::piece::*;
57
58mod rank;
59pub use crate::rank::*;
60
61mod square;
62pub use crate::square::*;
63
64mod movegen;
65pub use crate::movegen::MoveGen;
66
67mod zobrist;
68
69mod game;
70pub use crate::game::{Action, Game, GameResult};
71
72mod board_builder;
73pub use crate::board_builder::BoardBuilder;
74
75mod error;
76pub use crate::error::Error;