@@ -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 }
0 commit comments