aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2020-07-06 20:48:41 +0100
committerGitHub <noreply@github.com>2020-07-06 20:48:41 +0100
commit8164b11ba10da1d7a5d4241a393bad074b0a0cea (patch)
tree99e2ac1938ca82e97ccdbd996b2b8cc1160e1629
parentfff20dee4ec14ba882b0df62b8e3150cedf56e69 (diff)
parent607844c07c34a215ae0b40cb3fafea119086960a (diff)
downloadperlweeklychallenge-club-8164b11ba10da1d7a5d4241a393bad074b0a0cea.tar.gz
perlweeklychallenge-club-8164b11ba10da1d7a5d4241a393bad074b0a0cea.tar.bz2
perlweeklychallenge-club-8164b11ba10da1d7a5d4241a393bad074b0a0cea.zip
Merge pull request #1913 from ash/ash-068
Fix the solution
-rw-r--r--challenge-068/ash/raku/ch-1.raku8
1 files changed, 5 insertions, 3 deletions
diff --git a/challenge-068/ash/raku/ch-1.raku b/challenge-068/ash/raku/ch-1.raku
index 2da304eab0..1dc13f9803 100644
--- a/challenge-068/ash/raku/ch-1.raku
+++ b/challenge-068/ash/raku/ch-1.raku
@@ -10,9 +10,11 @@ my @input =
[1, 1, 1],
[1, 1, 1];
-for empty_lines(@input) X empty_lines([Z] @input) -> ($row, $col) {
- @input[$row][$_] = 0 for ^@input[0];
- @input[$_][$col] = 0 for ^@input;
+my @rows = empty_lines(@input);
+my @cols = empty_lines([Z] @input);
+
+for ((@rows X ^@input[0]), (^@input X @cols)).flat -> $row, $col {
+ @input[$row][$col] = 0;
}
say @input.join("\n");