fog-of-chess

[toy] Chess, but with the fog of war.
Log | Files | Refs

commit a36359de3663907046aec15c8b364db60b6c3dd7
parent de35316899662de5e074030a44a2a1a8ea22eee3
Author: Jack Mordaunt <jackmordaunt@gmail.com>
Date:   Thu, 26 Dec 2019 13:53:16 +1300

Feat: Rook movement.

Diffstat:
Msrc/main.rs | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs @@ -282,7 +282,13 @@ impl Game { (x + 1, y - 2), (x - 1, y - 2), ], - Rook => vec![], + Rook => vec![] + .into_iter() + .chain((1..8).map(|ii| (x + ii, y))) + .chain((1..8).map(|ii| (x - ii, y))) + .chain((1..8).map(|ii| (x, y + ii))) + .chain((1..8).map(|ii| (x, y - ii))) + .collect(), // King can move to any adjacent cell that isn't occupied by // a piece of the same player. King => vec![