Struct chess_engine::Board[][src]

pub struct Board { /* fields omitted */ }

Implementations

Create the default board for the Horde variant

Get the color of the current player

Get the position of the En-Passant square

Remove all of the pieces for a given player

Convert all of a given players pieces to queens

Make the game a certain player’s turn

Get the value of the material advantage of a certain player

Does a square have any piece?

Does a square have an ally piece?

If a square at a given position has an enemy piece from a given ally color, return true. Otherwise, return false.

For example, if a square has a black piece, and this method is called upon it with an ally_color of Color::White, then it will return true. If called with Color::Black upon the same square, however, it will return false.

If a square at a given position has any piece, return true. Otherwise, return false.

If a square at a given position has no piece, return true. Otherwise, return false.

If there is a king on the board, return the position that it sits on.

Is a square threatened by an enemy piece?

Get whether or not the king of a given color is in check.

Can a given player castle kingside?

Can a given player castle queenside?

Does the respective player have sufficient material?

Does the respective player have insufficient material?

Is the current player in stalemate?

Is the current player in checkmate?

Change the current turn to the next player.

Play a move and confirm it is legal.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Get the value of the board for a given color. This subtracts the opponents value, and accounts for piece positions and material value. Read more

Get the current player’s color.

Apply a move to the board for evaluation.

Get the legal moves for the current player.

Get the best move for the current player with depth number of moves of lookahead. Read more

Get the best move for the current player with depth number of moves of lookahead. Read more

Perform minimax on a certain position, and get the minimum or maximum value for a board. To get the best move, you minimize the values of the possible outcomes from your own position, and maximize the values of the replies made by the other player. Read more

Performs the conversion.

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.