aboutsummaryrefslogtreecommitdiff
path: root/src/moves.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/moves.rs')
-rw-r--r--src/moves.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/moves.rs b/src/moves.rs
index da66247..b338afe 100644
--- a/src/moves.rs
+++ b/src/moves.rs
@@ -27,7 +27,7 @@ impl Move {
/// Tactical move is a move that changes material score
pub fn is_tactical(&self) -> bool {
- matches!(self.kind, MoveKind::Capture | MoveKind::EnPassant)
+ matches!(self.kind, MoveKind::Capture | MoveKind::EnPassant | MoveKind::Promotion(_))
}
pub fn from_notation(mut notation: Chars) -> Self {
@@ -39,7 +39,7 @@ impl Move {
'r' => Piece::Rook,
'q' => Piece::Queen,
'b' => Piece::Bishop,
- 'k' => Piece::Knight,
+ 'n' => Piece::Knight,
_ => panic!("Illegal promotion piece: {:?}", promotion)
};
return Move { source, target, kind: MoveKind::Promotion(piece) }
@@ -56,7 +56,7 @@ impl Display for Move {
Piece::Rook => "r",
Piece::Queen => "q",
Piece::Bishop => "b",
- Piece::Knight => "k",
+ Piece::Knight => "n",
_ => panic!("Illegal promotion piece: {:?}", piece)
}
}