pub fn moves_for(&self, stone: Stone) -> u64 {
        let current_bits = self.bits_for(stone);
        let opponent_bits = self.bits_for(stone.flip());
        let empty_squares = self.empty_squares();

        let move_in_dir = |mask: u64, shift: i8| {
            let excluded: u64 = opponent_bits & mask;
            let mut m: u64 = dir_shift(current_bits, shift) & excluded;
            m |= dir_shift(m, shift) & excluded;
            m |= dir_shift(m, shift) & excluded;
            m |= dir_shift(m, shift) & excluded;
            m |= dir_shift(m, shift) & excluded;
            m |= dir_shift(m, shift) & excluded;
            dir_shift(m, shift) & empty_squares
        };

        let exclude_top_bottom = !(RANK_1 | RANK_8);
        let exclude_left_right = !(FILE_A | FILE_H);

        let mut moves = move_in_dir(exclude_top_bottom, -8);
        moves |= move_in_dir(exclude_left_right, -7);
        moves |= move_in_dir(exclude_left_right, 1);
        moves |= move_in_dir(exclude_left_right, 9);
        moves |= move_in_dir(exclude_top_bottom, 8);
        moves |= move_in_dir(exclude_left_right, 7);
        moves |= move_in_dir(exclude_left_right, -1);
        moves | move_in_dir(exclude_left_right, -9)
    }
/// Calculates and returns the set of all legal moves for the specified player.
///
/// The returned bitboard represents the Othello board. For a more detailed
/// description, refer to the documentation of the [`OthelloBoard struct`].
///
/// [`OthelloBoard struct`]: crate::othello::OthelloBoard
///
/// # Examples
/// ```rust
/// use magpie::othello::{OthelloBoard, Stone};
///
/// let board = OthelloBoard::standard();
/// let stone = Stone::Black;
/// assert_eq!(4, board.moves_for(stone).count_ones());
/// ```
Calculates and returns the set of all legal moves for the specified player.
The returned bitboard represents the Othello board. For a more detailed
description, refer to the documentation of the [`OthelloBoard struct`].


Calculates and returns the set of all legal moves for the specified player . The returned bitboard represents the Othello board . For a more detailed description refer to the documentation of the [ ` OthelloBoard struct ` ] .
pub fn moves_for(&self, stone: Stone) -> u64 {
        let current_bits = self.bits_for(stone);
        let opponent_bits = self.bits_for(stone.flip());
        let empty_squares = self.empty_squares();
        let move_in_dir = |mask: u64, shift: i8| {
            let excluded: u64 = opponent_bits & mask;
            let mut m: u64 = dir_shift(current_bits, shift) & excluded;
            m |= dir_shift(m, shift) & excluded;
            m |= dir_shift(m, shift) & excluded;
            m |= dir_shift(m, shift) & excluded;
            m |= dir_shift(m, shift) & excluded;
            m |= dir_shift(m, shift) & excluded;
            dir_shift(m, shift) & empty_squares
        };
        let exclude_top_bottom = !(RANK_1 | RANK_8);
        let exclude_left_right = !(FILE_A | FILE_H);
        let mut moves = move_in_dir(exclude_top_bottom, -8);
        moves |= move_in_dir(exclude_left_right, -7);
        moves |= move_in_dir(exclude_left_right, 1);
        moves |= move_in_dir(exclude_left_right, 9);
        moves |= move_in_dir(exclude_top_bottom, 8);
        moves |= move_in_dir(exclude_left_right, 7);
        moves |= move_in_dir(exclude_left_right, -1);
        moves | move_in_dir(exclude_left_right, -9)
    }
pub fn moves_for ( & self , stone : Stone ) -> u64 { let current_bits = self . bits_for ( stone ) ; let opponent_bits = self . bits_for ( stone . flip ( ) ) ; let empty_squares = self . empty_squares ( ) ; let move_in_dir = | mask : u64 , shift : i8 | { let excluded : u64 = opponent_bits & mask ; let mut m : u64 = dir_shift ( current_bits , shift ) & excluded ; m |= dir_shift ( m , shift ) & excluded ; m |= dir_shift ( m , shift ) & excluded ; m |= dir_shift ( m , shift ) & excluded ; m |= dir_shift ( m , shift ) & excluded ; m |= dir_shift ( m , shift ) & excluded ; dir_shift ( m , shift ) & empty_squares } ; let exclude_top_bottom = ! ( RANK_1 | RANK_8 ) ; let exclude_left_right = ! ( FILE_A | FILE_H ) ; let mut moves = move_in_dir ( exclude_top_bottom , - 8 ) ; moves |= move_in_dir ( exclude_left_right , - 7 ) ; moves |= move_in_dir ( exclude_left_right , 1 ) ; moves |= move_in_dir ( exclude_left_right , 9 ) ; moves |= move_in_dir ( exclude_top_bottom , 8 ) ; moves |= move_in_dir ( exclude_left_right , 7 ) ; moves |= move_in_dir ( exclude_left_right , - 1 ) ; moves | move_in_dir ( exclude_left_right , - 9 ) }
Calculates and returns the set of all legal moves for the specified player.
Calculates and returns the set of all legal moves for the specified player .
&self
stone
Stone
examples
```rust
use magpie::othello::{OthelloBoard, Stone}.

let board = OthelloBoard::standard();
let stone = Stone::Black;
assert_eq!(4, board.moves_for(stone).count_ones());
```
` ` ` rust use magpie :: othello :: { OthelloBoard Stone } . let board = OthelloBoard :: standard () ; let stone = Stone :: Black ; assert_eq! ( 4 board . moves_for ( stone ) . count_ones () ) ; ` ` `