diff options
| author | tslil clingman <> | 2020-01-20 23:09:52 -0800 |
|---|---|---|
| committer | tslil clingman <> | 2020-01-20 23:09:52 -0800 |
| commit | ec4ae2a749315720cc12f3d71f0860e2a32f96d2 (patch) | |
| tree | 36c884dbfc6f1e04e0a02d6a7be78a98d2930fd6 /src/parser.rs | |
| parent | 42e504281ba8c36c0bf5c679dd767f04310655f3 (diff) | |
Move rules were incorrectly/incompletely implemented
Diffstat (limited to 'src/parser.rs')
| -rw-r--r-- | src/parser.rs | 8 |
1 files changed, 5 insertions, 3 deletions
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<Action, String> { } 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; |
