You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
579 B

use queens::*;
fn main() {
let white_queen = Queen::new(ChessPosition::new(2, 2).unwrap());
let black_queen = Queen::new(ChessPosition::new(0, 4).unwrap());
println!(
"Is it possible for the queens to attack each other? => {}",
white_queen.can_attack(&black_queen)
);
let white_queen = Queen::new(ChessPosition::new(1, 2).unwrap());
let black_queen = Queen::new(ChessPosition::new(0, 4).unwrap());
println!(
"Is it possible for the queens to attack each other? => {}",
white_queen.can_attack(&black_queen)
);
}