Skip to content

Commit 0c2a68b

Browse files
committed
Cleanup println's
1 parent 9672837 commit 0c2a68b

4 files changed

Lines changed: 0 additions & 21 deletions

File tree

check-buddy-pgn-parser/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,12 @@ impl PgnParser {
4444
let _winning = uci_line.pop();
4545

4646
for moves in uci_line.iter() {
47-
println!("{moves:?}");
4847
let (move1, move2) = (moves[1], moves[2]);
4948

5049
let uci_move1 = game.board_map.parse_uci_to_move(move1)?;
51-
println!("{:?}", uci_move1);
5250
game.board_map.uci_move_turn(uci_move1)?;
53-
println!("{:?}", game.board_map);
5451
let uci_move2 = game.board_map.parse_uci_to_move(move2)?;
55-
println!("{:?}", uci_move2);
5652
game.board_map.uci_move_turn(uci_move2)?;
57-
println!("{:?}", game.board_map);
5853
}
5954

6055
Ok(())

check-buddy/src/algorithm.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ impl ChessEngine {
180180
} else {
181181
-1.
182182
};
183-
// println!("{material_weight} * ({num_white_pieces} - {num_black_pieces}) * {who2move}");
184183
material_weight * (num_white_pieces - num_black_pieces) * who2move
185184
}
186185
}

check-buddy/src/board.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ impl BoardMap {
377377
if let Some(position) = found_position {
378378
position
379379
} else {
380-
println!("{:?}", self);
381380
return Err(anyhow!(
382381
"Couldn't find [from] position for {:?} with [to] {:?}",
383382
uci,
@@ -581,7 +580,6 @@ impl BoardMap {
581580

582581
temp_board.undo_move(position_move, last_piece);
583582
}
584-
// eprintln!("legal positions {:?} {:?}", &from, &legal_positions);
585583
legal_positions
586584
}
587585
/// generate all possible move position for piece
@@ -617,15 +615,13 @@ impl BoardMap {
617615

618616
if target_piece.is_piece() && target_piece.get_color() == piece_from.get_color() {
619617
// your own color is in the way
620-
// eprintln!("Piece is yours! {:?}",target_move);
621618
break;
622619
}
623620
positions.push(target_position);
624621
// self.squares[target_move[0]][target_move[1]] = Piece(100);
625622

626623
if target_piece.is_piece() && target_piece.get_color() != piece_from.get_color() {
627624
// Enemy piece and capturable
628-
// eprintln!("Piece is not yours, but you should still break the loop!");
629625
break;
630626
}
631627
}
@@ -648,15 +644,12 @@ impl BoardMap {
648644

649645
if target_piece.is_piece() && target_piece.get_color() == piece_from.get_color() {
650646
// your own color is in the way
651-
// eprintlnln!("Piece is yours!");
652647
continue;
653648
}
654649
positions.push(target_move);
655-
// self.squares[target_move[0]][target_move[1]] = Piece(100);
656650

657651
if target_piece.is_piece() && target_piece.get_color() != piece_from.get_color() {
658652
// Enemy piece and capturable
659-
// eprintln!("A piece that's yours is blocking any other moves");
660653
continue;
661654
}
662655
}
@@ -726,7 +719,6 @@ impl BoardMap {
726719
let to_left = self.squares[from[0]][from[1] - 1];
727720
if let Some(PieceType::Pawn(en_passantable)) = to_left.get_type() {
728721
if en_passantable && to_left.get_color() != piece_from.get_color() {
729-
// eprintln!("piece on left ({:?}) is en passantable!", [from[0], from[1] - 1]);
730722
let to_en_passant = [(from[0] as i32 + shift) as usize, from[1] - 1];
731723
moves.push(to_en_passant);
732724
}
@@ -751,7 +743,6 @@ impl BoardMap {
751743
let to_right = self.squares[from[0]][from[1] + 1];
752744
if let Some(PieceType::Pawn(en_passantable)) = to_right.get_type() {
753745
if en_passantable && to_right.get_color() != piece_from.get_color() {
754-
// eprintln!("piece on right ({:?}) is en passantable!", [from[0], from[1] + 1]);
755746
let to_en_passant = [(from[0] as i32 + shift) as usize, from[1] + 1];
756747
moves.push(to_en_passant);
757748
}
@@ -808,16 +799,13 @@ impl BoardMap {
808799
promotion,
809800
} = position_move;
810801
if en_passant {
811-
// eprintln!("move is an en passant! {from:?} {to:?}");
812802
let shift = if self.get_piece(from).get_color() == PieceColor::Black {
813803
1
814804
} else {
815805
-1
816806
};
817807
let to_step = [(to[0] as isize - shift) as usize, to[1]];
818-
// if to_step[0] != 0 && to_step[1] != 0 && to_step[0] != 8 {
819808
self.set_piece(to_step, 0);
820-
// }
821809
}
822810
if promotion {
823811
let color = match self.get_piece(from).get_color() {
@@ -869,7 +857,6 @@ impl BoardMap {
869857
for file in 0..8 {
870858
let piece = self.squares[rank][file];
871859
if piece.is_piece() && piece.get_color() != self.active_color {
872-
// eprintln!("found enemy piece! {:?}", moves);
873860
let positions = self.gen_to_positions([rank, file]);
874861
opponent_positions.extend(positions);
875862
}
@@ -1048,7 +1035,6 @@ impl BoardMap {
10481035
let should_enable_en_passant = self.move_should_enable_en_passant(position_move);
10491036

10501037
if should_enable_en_passant {
1051-
// eprintln!("Piece became en passantable! ({},{})", to[0], to[1]);
10521038
if self.get_piece(to).0 < 32 {
10531039
self.get_piece_mut(to).0 += 32;
10541040
}

check-buddy/tests/best_move_validation.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ fn best_move_should_be_valid() {
2828
.any(|(from, to)| from == best_from && to == best_to)
2929
{
3030
let piece = board_map.get_piece(*best_from);
31-
println! {"{:?}", board_map};
3231
panic!(
3332
"{:?} from {:?} to {:?} isn't seen as a valid move",
3433
piece, best_from, best_to

0 commit comments

Comments
 (0)