queen-attack: Displaying ChessPosition and Queen structs in the unimplemented! message
+#[derive(Debug)]
pub struct ChessPosition;
+#[derive(Debug)]
pub struct Queen;
impl ChessPosition {
@@ -9,11 +11,17 @@ impl ChessPosition {
}
impl Queen {
- pub fn new(_position: ChessPosition) -> Self {
- unimplemented!("Given the chess position, construct a Queen struct.");
+ pub fn new(position: ChessPosition) -> Self {
+ unimplemented!(
+ "Given the chess position {:?}, construct a Queen struct.",
+ position
+ );
}
- pub fn can_attack(&self, _other: &Queen) -> bool {
- unimplemented!("Determine if this Queen can attack the other Queen");
+ pub fn can_attack(&self, other: &Queen) -> bool {
+ unimplemented!(
+ "Determine if this Queen can attack the other Queen {:?}",
+ other
+ );
}
}
