commit 3117ddd23cab1a363df99ab1b678ccb61a177615
parent a36359de3663907046aec15c8b364db60b6c3dd7
Author: Jack Mordaunt <jackmordaunt@gmail.com>
Date: Thu, 26 Dec 2019 13:56:14 +1300
Doc: Movement descriptions.
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/main.rs b/src/main.rs
@@ -272,6 +272,7 @@ impl Game {
};
moves
}
+ // Knight moves in an L shape: two out, one across.
Knight => vec![
(x + 2, y - 1),
(x + 2, y + 1),
@@ -282,6 +283,7 @@ impl Game {
(x + 1, y - 2),
(x - 1, y - 2),
],
+ // Rook moves in all non diagonal directions.
Rook => vec![]
.into_iter()
.chain((1..8).map(|ii| (x + ii, y)))
@@ -289,6 +291,7 @@ impl Game {
.chain((1..8).map(|ii| (x, y + ii)))
.chain((1..8).map(|ii| (x, y - ii)))
.collect(),
+ Bishop => vec![],
// King can move to any adjacent cell that isn't occupied by
// a piece of the same player.
King => vec![