From 559f0db891b73eaf115d57d26e0fe2376a4a5ed2 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 15 Nov 2014 02:56:31 +0100 Subject: [PATCH] Slightly better diagnostics. --- Board.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Board.pm b/Board.pm index 2edc07d..39c8134 100644 --- a/Board.pm +++ b/Board.pm @@ -200,8 +200,11 @@ sub parse_pretty_move { push @squares, [ $row, $col ]; } } + if (scalar @squares == 0) { + die "Impossible move $move"; + } if (scalar @squares != 1) { - die "Ambigious or impossible move $move"; + die "Ambigious move $move"; } return (@{$squares[0]}, $to_row, $to_col, $promo); } -- 2.39.5