cleanup
This commit is contained in:
@@ -68,7 +68,7 @@ impl Board {
|
||||
}
|
||||
|
||||
pub fn what_if(&self, i: usize, j: usize, piece: Piece) -> Option<(Self, usize)> {
|
||||
let mut self_copy = self.clone();
|
||||
let mut self_copy = *self;
|
||||
if self_copy.get(i, j).is_some() {
|
||||
return None;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ impl Board {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
Err(format!("move would not propegate"))
|
||||
Err("move would not propegate".to_string())
|
||||
}
|
||||
|
||||
/// Propegate piece captures originating from (i, j)
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
use crate::{
|
||||
agent::Agent,
|
||||
board::{Board, BOARD_SIZE},
|
||||
misc::offsets,
|
||||
piece::Piece,
|
||||
};
|
||||
use rand::{rngs::ThreadRng, seq::IteratorRandom};
|
||||
|
||||
pub struct ComplexAgent {
|
||||
color: Piece,
|
||||
rng: ThreadRng,
|
||||
}
|
||||
|
||||
impl Agent for ComplexAgent {
|
||||
@@ -36,9 +33,6 @@ impl Agent for ComplexAgent {
|
||||
|
||||
impl ComplexAgent {
|
||||
pub fn new(color: Piece) -> Self {
|
||||
Self {
|
||||
color,
|
||||
rng: rand::rng(),
|
||||
}
|
||||
Self { color }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user