cleanup and fix warnings

This commit is contained in:
Simon Gardling 2025-03-11 09:46:19 -04:00
parent 69dc686d0a
commit 0c832b1c7b
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
4 changed files with 13 additions and 6 deletions

View File

@ -7,9 +7,7 @@ use crate::{
logic::{ChildrenEvalMethod, FutureMoveConfig},
repr::{Board, Piece, Winner},
};
use indicatif::{
ParallelProgressIterator, ProgressBar, ProgressDrawTarget, ProgressStyle, TermLike,
};
use indicatif::{ParallelProgressIterator, ProgressBar, ProgressDrawTarget, ProgressStyle};
use rand::seq::SliceRandom;
use rayon::iter::{IntoParallelIterator, ParallelIterator};
use skillratings::{
@ -17,6 +15,7 @@ use skillratings::{
Outcomes, Rating,
};
#[allow(dead_code)]
pub fn run() {
const FMV_BASE: FutureMoveConfig = FutureMoveConfig {
max_depth: 20,

View File

@ -74,6 +74,7 @@ impl std::fmt::Display for FutureMoveConfig {
}
#[derive(Debug, Clone, Copy)]
#[allow(dead_code)]
pub enum ChildrenEvalMethod {
/// Best (by far) strat compared to Max or Min
Average,
@ -168,6 +169,7 @@ impl FutureMoves {
}
}
#[allow(dead_code)]
fn remove(&mut self, index: usize) {
if let Some(parent) = self.arena[index].parent {
self.arena[parent].children.retain(|&j| j != index);
@ -410,6 +412,7 @@ impl FutureMoves {
/// Checks the consistancy of the Arena (parents and children)
/// returns a vector of errors ([`String`])
#[allow(dead_code)]
pub fn check_arena(&self) -> Vec<String> {
let mut errors = vec![];
for idx in 0..self.arena.len() {

View File

@ -1,7 +1,11 @@
use super::{bitboard::BitBoard, piece::Piece, CoordAxis, CoordPair};
use arrayvec::ArrayVec;
use rand::seq::IteratorRandom;
use std::{cmp::Ordering, fmt};
use std::{
cmp::Ordering,
fmt,
ops::{BitAndAssign, BitOrAssign},
};
/// Map of all points on the board against some type T
/// Used to index like so: example[i][j]
@ -274,8 +278,8 @@ impl Board {
}
fn apply_flip_mask(&mut self, color: Piece, flip_mask: BitBoard) {
*get_board!(mut self, color) |= flip_mask;
*get_board!(mut self, color.flip()) &= !flip_mask;
get_board!(mut self, color).bitor_assign(flip_mask);
get_board!(mut self, color.flip()).bitand_assign(!flip_mask);
}
/// Propegate piece captures originating from (i, j)

View File

@ -20,6 +20,7 @@ impl CoordPair {
Self(row * Board::BOARD_SIZE + col)
}
#[allow(clippy::wrong_self_convention)]
fn into_indexes(&self) -> (CoordAxis, CoordAxis) {
self.0.div_mod_floor(&Board::BOARD_SIZE)
}