[−][src]Struct pleco::board::RandBoard
Random Board
generator. Creates either one or many random boards with optional
parameters.
Examples
Create one Board
with at least 5 moves played that is created in a pseudo-random
fashion.
use pleco::board::{Board,RandBoard}; let rand_boards: Board = RandBoard::new() .pseudo_random(12455) .min_moves(5) .one();
Create a Vec
of 10 random Board
s that are guaranteed to not be in check.
use pleco::board::{Board,RandBoard}; let rand_boards: Vec<Board> = RandBoard::new() .pseudo_random(12455) .no_check() .many(10);
Methods
impl RandBoard
[src]
pub fn new() -> Self
[src]
Create a new RandBoard
object.
pub fn many(self, size: usize) -> Vec<Board>
[src]
Creates a Vec<Board>
full of Boards
containing random positions. The
Vec
will be of size 'size'.
pub fn one(self) -> Board
[src]
Creates a singular Board
with a random position.
pub fn pseudo_random(self, seed: u64) -> Self
[src]
Turns PseudoRandom generation on. This allows for the same random Board
s
to be created from the same seed.
pub fn min_moves(self, moves: u16) -> Self
[src]
Sets the minimum moves a randomly generated Board
must contain.
pub fn in_check(self) -> Self
[src]
Guarantees that the boards returned are only in check,
pub fn no_check(self) -> Self
[src]
Guarantees that the boards returned are not in check.
pub fn from_start_pos(self) -> Self
[src]
Generates Random Boards from the start position only
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,