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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! # Yet another Rust chess library
//!
//! ## 🦉🦉🦉
//!
//! Owlchess is a chess library written in Rust, with emphasis on both speed and safety.
//! Primarily designed for various chess GUIs and tools, it's also possible to use Owlchess
//! to build a fast chess engine.
//!
//! The code is mostly derived from my chess engine [SoFCheck](https://github.com/alex65536/sofcheck),
//! but rewritten in Rust with regard to safety.
//!
//! This crate supports core chess functionality:
//!
//! - generate moves
//! - make moves
//! - calculate game outcome
//! - parse and format boards in [FEN](https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation)
//! - parse and format moves in UCI and [SAN](https://en.wikipedia.org/wiki/Algebraic_notation_\(chess\))
//!
//! ## Example
//!
//! ```
//! use owlchess::{Board, movegen::legal, Move};
//! use owlchess::{Coord, File, Rank};
//!
//! // Create a board with initial position
//! let b = Board::initial();
//!
//! // Generate all the legal moves
//! let moves = legal::gen_all(&b);
//! assert_eq!(moves.len(), 20);
//!
//! // Parse move "e2e4" from UCI string
//! let mv = Move::from_uci("e2e4", &b).unwrap();
//! let e2 = Coord::from_parts(File::E, Rank::R2);
//! let e4 = Coord::from_parts(File::E, Rank::R4);
//! assert_eq!(mv.src(), e2);
//! assert_eq!(mv.dst(), e4);
//!
//! // Create a new board with made move `mv`
//! let b = b.make_move(mv).unwrap();
//! assert_eq!(b.as_fen(), "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1");
//! ```
pub use bitboard;
pub use types;
use bitboard_consts;
use geometry;
pub use Bitboard;
pub use ;
pub use MoveChain;
pub use ;
pub use ;
pub use ;