cargo clippy
This commit is contained in:
@@ -44,7 +44,7 @@ impl fmt::Display for Board {
|
|||||||
)?;
|
)?;
|
||||||
|
|
||||||
// Print game over screen
|
// Print game over screen
|
||||||
if self.game_over() == true {
|
if self.game_over() {
|
||||||
match self.get_winner() {
|
match self.get_winner() {
|
||||||
Some(Piece::Black) => writeln!(f, "Black Wins"),
|
Some(Piece::Black) => writeln!(f, "Black Wins"),
|
||||||
Some(Piece::White) => writeln!(f, "White Wins"),
|
Some(Piece::White) => writeln!(f, "White Wins"),
|
||||||
@@ -225,11 +225,7 @@ impl Board {
|
|||||||
let max_score = BOARD_SIZE * BOARD_SIZE;
|
let max_score = BOARD_SIZE * BOARD_SIZE;
|
||||||
let combined_score = black_score + white_score;
|
let combined_score = black_score + white_score;
|
||||||
|
|
||||||
if max_score == combined_score {
|
max_score == combined_score
|
||||||
true
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ fn problem_space(board: &Board, color: Piece) -> Vec<Move> {
|
|||||||
impl Agent for ComplexAgent {
|
impl Agent for ComplexAgent {
|
||||||
fn next_move(&mut self, board: &Board) -> Option<(usize, usize)> {
|
fn next_move(&mut self, board: &Board) -> Option<(usize, usize)> {
|
||||||
const LOOPS: usize = 5;
|
const LOOPS: usize = 5;
|
||||||
problem_space(&board, self.color)
|
problem_space(board, self.color)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|mut x| {
|
.map(|mut x| {
|
||||||
x.populate_next_moves(LOOPS);
|
x.populate_next_moves(LOOPS);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ impl Game {
|
|||||||
println!("{}", self);
|
println!("{}", self);
|
||||||
|
|
||||||
// Check if the game is over
|
// Check if the game is over
|
||||||
if self.board.game_over() == true {
|
if self.board.game_over() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user