<commit_before>use std::slice::Iter;
use std::str::Chars;

use std::ops::BitAnd;
use std::ops::BitAndAssign;
use std::ops::BitOr;
use std::ops::BitXorAssign;
use std::ops::Sub;
use std::ops::BitXor;

#[derive(Debug, PartialEq, Clone, Copy)]
pub struct Bitboard(u64);

impl Bitboard {
    pub const fn new(bb: u64) -> Bitboard { return Bitboard(bb); }

    pub fn bitscan_forward(self) -> Square { return Square(self.0.trailing_zeros()); }
    pub fn bitscan_reverse(self) -> Square { return Square(63 - self.0.leading_zeros()); }
    pub fn nonempty(self) -> bool { return self.0 != 0; }
    pub fn empty(self) -> bool { return self.0 == 0; }

    pub fn shifted_left(self) -> Bitboard { return Bitboard(self.0 >> 1); }
    pub fn shifted_right(self) -> Bitboard { return Bitboard(self.0 << 1); }
    pub fn shifted_down(self) -> Bitboard { return Bitboard(self.0 >> 8); }
    pub fn shifted_up(self) -> Bitboard { return Bitboard(self.0 << 8); }

    // pub fn set_piece_bit(&mut self, sq: Square, color: Color, piece: PieceType) { 
}

// fn bitboard_array(data: &[u8], ret: &mut [u8], len: u8) -> 

impl BitAnd for Bitboard {
    type Output = Bitboard;
    fn bitand(self, rhs: Bitboard) -> Bitboard {
        Bitboard(self.0 & rhs.0)
    }
}

impl BitAndAssign for Bitboard {
    fn bitand_assign(&mut self, rhs: Bitboard) {
        *self = Bitboard(self.0 & rhs.0)
    }
}

impl BitOr for Bitboard {
    type Output = Self;

    fn bitor(self, rhs: Self) -> Self {
        Bitboard(self.0 | rhs.0)
    }
}

impl BitXorAssign for Bitboard {
    fn bitxor_assign(&mut self, rhs: Self) {
        self.0 ^= rhs.0;
    }
}

impl BitXor for Bitboard {<commit_msg>removed cruft<commit_after>use std::slice::Iter;
use std::str::Chars;

use std::ops::BitAnd;
use std::ops::BitAndAssign;
use std::ops::BitOr;
use std::ops::BitXorAssign;
use std::ops::Sub;
use std::ops::BitXor;

#[derive(Debug, PartialEq, Clone, Copy)]
pub struct Bitboard(u64);

impl Bitboard {
    pub const fn new(bb: u64) -> Bitboard { return Bitboard(bb); }

    pub fn bitscan_forward(self) -> Square { return Square(self.0.trailing_zeros()); }
    pub fn bitscan_reverse(self) -> Square { return Square(63 - self.0.leading_zeros()); }
    pub fn nonempty(self) -> bool { return self.0 != 0; }
    pub fn empty(self) -> bool { return self.0 == 0; }

    pub fn shifted_left(self) -> Bitboard { return Bitboard(self.0 >> 1); }
    pub fn shifted_right(self) -> Bitboard { return Bitboard(self.0 << 1); }
    pub fn shifted_down(self) -> Bitboard { return Bitboard(self.0 >> 8); }
    pub fn shifted_up(self) -> Bitboard { return Bitboard(self.0 << 8); }
}

impl BitAnd for Bitboard {
    type Output = Bitboard;
    fn bitand(self, rhs: Bitboard) -> Bitboard {
        Bitboard(self.0 & rhs.0)
    }
}

impl BitAndAssign for Bitboard {
    fn bitand_assign(&mut self, rhs: Bitboard) {
        *self = Bitboard(self.0 & rhs.0)
    }
}

impl BitOr for Bitboard {
    type Output = Self;

    fn bitor(self, rhs: Self) -> Self {
        Bitboard(self.0 | rhs.0)
    }
}

impl BitXorAssign for Bitboard {
    fn bitxor_assign(&mut self, rhs: Self) {
        self.0 ^= rhs.0;
    }
}

impl BitXor for Bitboard {
{'fraction_non_alphanumeric': 0.15159155373463598, 'fraction_numerical': 0.018594390167034354, 'mean_word_length': 3.271870794078062, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6381870', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1135, 'n_words': 305}