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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
//! A blazingly fast Chess Library. //! //! This package is separated into two parts. Firstly, the board representation & associated functions (the current crate, `pleco`), and secondly, //! the AI implementations [pleco_engine](https://crates.io/crates/pleco_engine). //! //! # Usage //! //! This crate is [on crates.io](https://crates.io/crates/pleco) and can be //! used by adding `pleco` to the dependencies in your project's `Cargo.toml`. //! //! `pleco` requires nightly rust currently, so make sure your toolchain is a nightly version. //! //! # Examples //! //! You can create a [`Board`] with the starting position like so: //! //! ```ignore //! use pleco::Board; //! let board = Board::default(); //! ``` //! //! Generating a list of moves (Contained inside a [`MoveList`]) can be done with: //! //! ```ignore //! let list = board.generate_moves(); //! ``` //! //! Applying and undoing moves is simple: //! //! ```ignore //! let mut board = Board::default(); //! let list = board.generate_moves(); //! //! for mov in list.iter() { //! board.apply_move(*mov); //! println!("{}",board.get_fen()); //! board.undo_move(); //! } //! ``` //! //! Using fen strings is also supported: //! //! ```ignore //! let start_position = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"; //! let board = Board::new_from_fen(start_position); //! ``` //! //! [`MoveList`]: core/move_list/struct.MoveList.html //! [`Board`]: board/struct.Board.html #![cfg_attr(feature="clippy", feature(plugin))] #![cfg_attr(feature="clippy", plugin(clippy))] #![cfg_attr(feature="clippy", allow(inline_always))] #![cfg_attr(feature="clippy", allow(unreadable_literal))] #![cfg_attr(feature="clippy", allow(large_digit_groups))] #![cfg_attr(feature="clippy", allow(cast_lossless))] #![cfg_attr(feature="clippy", allow(doc_markdown))] #![cfg_attr(feature="clippy", allow(inconsistent_digit_grouping))] #![cfg_attr(feature = "dev", allow(unstable_features))] #![cfg_attr(test, allow(dead_code))] #![feature(integer_atomics)] #![feature(fused)] #![feature(trusted_len)] #![feature(test)] #![allow(dead_code)] #![feature(integer_atomics)] #![feature(unique)] #![feature(allocator_api)] // [`Vec<T>`]: ../../std/vec/struct.Vec.html // [`new`]: ../../std/vec/struct.Vec.html#method.new // [`push`]: ../../std/vec/struct.Vec.html#method.push // [`Index`]: ../../std/ops/trait.Index.html // [`IndexMut`]: ../../std/ops/trait.IndexMut.html // [`vec!`]: ../../std/macro.vec.html #[macro_use] extern crate bitflags; #[macro_use] extern crate lazy_static; extern crate failure; #[macro_use] extern crate failure_derive; extern crate test; extern crate rayon; extern crate num_cpus; extern crate rand; pub mod core; pub mod board; pub mod tools; pub mod bots; pub mod bot_prelude; #[doc(no_inline)] pub use board::Board; #[doc(no_inline)] pub use core::piece_move::BitMove; #[doc(no_inline)] pub use core::move_list::MoveList; #[doc(no_inline)] pub use core::sq::SQ; #[doc(no_inline)] pub use core::bitboard::BitBoard; #[doc(no_inline)] pub use core::{Player,Piece,Rank,File};