Struct shakmaty::bitboard::Bitboard[][src]

pub struct Bitboard(pub u64);

A set of squares represented by a 64 bit integer mask.

Examples

let mask = Bitboard::from(Rank::Third).with(Square::E5);
// . . . . . . . .
// . . . . . . . .
// . . . . . . . .
// . . . . 1 . . .
// . . . . . . . .
// 1 1 1 1 1 1 1 1
// . . . . . . . .
// . . . . . . . .

assert_eq!(mask.first(), Some(Square::A3));

Methods

impl Bitboard
[src]

A bitboard with a single square.

Returns the bitboard containing all squares of the given rank.

Returns the bitboard containing all squares of the given file.

Like rank(), but from the point of view of color.

Shift using << for White and >> for Black.

Important traits for CarryRippler

An iterator over the subsets of this bitboard.

EMPTY: Bitboard = Bitboard(0)

An empty bitboard.

ALL: Bitboard = Bitboard(!0u64)

A bitboard containing all squares.

DARK_SQUARES: Bitboard = Bitboard(12273903644374837845)

All dark squares.

LIGHT_SQUARES: Bitboard = Bitboard(6172840429334713770)

All light squares.

CORNERS: Bitboard = Bitboard(9295429630892703873)

The four corner squares.

BACKRANKS: Bitboard = Bitboard(18374686479671623935)

The backranks.

CENTER: Bitboard = Bitboard(103481868288)

The four center squares.

Trait Implementations

impl Copy for Bitboard
[src]

impl Clone for Bitboard
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Eq for Bitboard
[src]

impl PartialEq for Bitboard
[src]

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

This method tests for !=.

impl Ord for Bitboard
[src]

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

impl PartialOrd for Bitboard
[src]

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

impl Hash for Bitboard
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Default for Bitboard
[src]

Returns the "default value" for a type. Read more

impl Debug for Bitboard
[src]

Formats the value using the given formatter. Read more

impl UpperHex for Bitboard
[src]

Formats the value using the given formatter.

impl LowerHex for Bitboard
[src]

Formats the value using the given formatter.

impl Octal for Bitboard
[src]

Formats the value using the given formatter.

impl Binary for Bitboard
[src]

Formats the value using the given formatter.

impl From<Square> for Bitboard
[src]

Performs the conversion.

impl From<Rank> for Bitboard
[src]

Performs the conversion.

impl From<File> for Bitboard
[src]

Performs the conversion.

impl From<u64> for Bitboard
[src]

Performs the conversion.

impl From<Bitboard> for u64
[src]

Performs the conversion.

impl<T> BitAnd<T> for Bitboard where
    T: Into<Bitboard>, 
[src]

The resulting type after applying the & operator.

Performs the & operation.

impl<T> BitAndAssign<T> for Bitboard where
    T: Into<Bitboard>, 
[src]

Performs the &= operation.

impl<T> BitOr<T> for Bitboard where
    T: Into<Bitboard>, 
[src]

The resulting type after applying the | operator.

Performs the | operation.

impl<T> BitOrAssign<T> for Bitboard where
    T: Into<Bitboard>, 
[src]

Performs the |= operation.

impl<T> BitXor<T> for Bitboard where
    T: Into<Bitboard>, 
[src]

The resulting type after applying the ^ operator.

Performs the ^ operation.

impl<T> BitXorAssign<T> for Bitboard where
    T: Into<Bitboard>, 
[src]

Performs the ^= operation.

impl Not for Bitboard
[src]

The resulting type after applying the ! operator.

Performs the unary ! operation.

impl FromIterator<Square> for Bitboard
[src]

Creates a value from an iterator. Read more

impl Extend<Square> for Bitboard
[src]

Extends a collection with the contents of an iterator. Read more

impl IntoIterator for Bitboard
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Important traits for IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations

impl Send for Bitboard

impl Sync for Bitboard