use an OR in a spot where it will help some tiny amount, set up doc
This commit is contained in:
parent
4e74d926b0
commit
08e0b11db9
9 changed files with 13632 additions and 5 deletions
|
|
@ -144,6 +144,7 @@ impl Display for BitBoard {
|
|||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn shift_in_direction(magnitude: i8, value: Board) -> Board {
|
||||
if magnitude >= 0 {
|
||||
let (result, _) = value.overflowing_shl(magnitude.unsigned_abs() as u32);
|
||||
|
|
@ -374,10 +375,8 @@ impl BitBoard {
|
|||
}
|
||||
}
|
||||
|
||||
self.boards[current_team_idx] += flips;
|
||||
self.boards[current_team_idx] |= flips | play;
|
||||
self.boards[current_team.next() as usize] ^= flips;
|
||||
|
||||
self.boards[current_team_idx] += play;
|
||||
}
|
||||
|
||||
/// Compute the score (B, W) by counting the excited bits in each board.
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ impl Game {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::board::{squares::*, view::View};
|
||||
use crate::board::squares::*;
|
||||
#[test]
|
||||
fn play_switches_team() {
|
||||
let mut game = Game::default();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue