From ec4ae2a749315720cc12f3d71f0860e2a32f96d2 Mon Sep 17 00:00:00 2001 From: tslil clingman <> Date: Mon, 20 Jan 2020 23:09:52 -0800 Subject: Move rules were incorrectly/incompletely implemented --- src/parser.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/parser.rs') diff --git a/src/parser.rs b/src/parser.rs index 346ecb2..a1d9a32 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -116,9 +116,11 @@ fn parse_place(player: Player, pl: &str) -> Result { } if (x < 'a') || (x > 'h') { - return Err(String::from( - "Placements must specify a valid position on the game board.", - )); + return Err(if (x >= 'A') && (x <= 'Z') { + format!("Unrecognised stone type '{}' in placement.", x) + } else { + String::from("Placements must specify a valid position on the game board.") + }); } let x: u8 = x as u8 - 'a' as u8; -- cgit v1.3.1