Struct pleco::board::RandBoard [−][src]
pub struct RandBoard { /* fields omitted */ }
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]
impl RandBoard
pub fn new() -> Self
[src]
pub fn new() -> Self
Create a new RandBoard
object.
pub fn many(self, size: usize) -> Vec<Board>
[src]
pub fn many(self, size: usize) -> Vec<Board>
Creates a Vec<Board>
full of Boards
containing random positions. The
Vec
will be of size 'size'.
pub fn one(self) -> Board
[src]
pub fn one(self) -> Board
Creates a singular Board
with a random position.
pub fn pseudo_random(self, seed: u64) -> Self
[src]
pub fn pseudo_random(self, seed: u64) -> Self
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]
pub fn min_moves(self, moves: u16) -> Self
Sets the minimum moves a randomly generated Board
must contain.
pub fn in_check(self) -> Self
[src]
pub fn in_check(self) -> Self
Guarantees that the boards returned are only in check,
pub fn no_check(self) -> Self
[src]
pub fn no_check(self) -> Self
Guarantees that the boards returned are not in check.
pub fn from_start_pos(self) -> Self
[src]
pub fn from_start_pos(self) -> Self
Generates Random Boards from the start position only