From c8538d2ca4d8315d87d9800933d037b1353d9b45 Mon Sep 17 00:00:00 2001 From: Abigail Date: Wed, 11 Nov 2020 14:22:59 +0100 Subject: Ignore lines not containing clues. That is, any line which doesn't contain an underscore, digit or capital ASCII letter will be ignored. This makes inputting large sudoku's a tad bit easier, allowing blank lines or hyphens between blocks. --- challenge-086/abigail/perl/ch-2.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/challenge-086/abigail/perl/ch-2.pl b/challenge-086/abigail/perl/ch-2.pl index 27f5a28b38..ab4cdc766b 100644 --- a/challenge-086/abigail/perl/ch-2.pl +++ b/challenge-086/abigail/perl/ch-2.pl @@ -19,7 +19,8 @@ use experimental 'lexical_subs'; my @sudoku = map {[map {/_/ ? 0 : /[A-Z]/ ? 10 + ord ($_) - ord ('A') : $_} - /\b(?:_+|[1-9][0-9]*|[A-Z])\b/g]} <>; + /\b(?:_+|[1-9][0-9]*|[A-Z])\b/g]} + grep {/[_1-9A-Z]/} <>; my $SIZE = @sudoku; my @INDICES = (0 .. $SIZE - 1); my @ELEMENTS = (1 .. $SIZE); -- cgit