We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, im trying to wrap my head how i should accuire the material for Black, Respective White using a given board?
The text was updated successfully, but these errors were encountered:
I implemented how i think it should look like. Don't know how efficient it is.
fn score_board(board: &Board, color: chess::Color) -> u16 { let b = board.color_combined(color).0; let mut sum = 0u16; for i in 0..64u64 { if b & (1 << i) != 0 { let a:Square = ALL_SQUARES[i as usize]; sum += match board.piece_on(a).unwrap() { Piece::Pawn => {1}, Piece::Knight => {3}, Piece::Bishop => {3}, Piece::Rook => {5}, Piece::Queen => {9}, Piece::King => {100}, } } } sum }
Sorry, something went wrong.
No branches or pull requests
Hello, im trying to wrap my head how i should accuire the material for Black, Respective White using a given board?
The text was updated successfully, but these errors were encountered: