aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-068/ash/README2
-rw-r--r--challenge-068/ash/blog.txt1
-rw-r--r--challenge-068/ash/raku/ch-1.raku28
3 files changed, 30 insertions, 1 deletions
diff --git a/challenge-068/ash/README b/challenge-068/ash/README
index af4866aec7..c5f4656b17 100644
--- a/challenge-068/ash/README
+++ b/challenge-068/ash/README
@@ -1,3 +1,3 @@
Solution by Andrew Shitov
-Comments to the tasks 1 and 2: https://andrewshitov.com/2020/06/29/combinations-in-raku/
+Comments to the task 1: https://andrewshitov.com/2020/07/06/raku-challenge-week-68/
diff --git a/challenge-068/ash/blog.txt b/challenge-068/ash/blog.txt
new file mode 100644
index 0000000000..d2b4173d0b
--- /dev/null
+++ b/challenge-068/ash/blog.txt
@@ -0,0 +1 @@
+https://andrewshitov.com/2020/07/06/raku-challenge-week-68/
diff --git a/challenge-068/ash/raku/ch-1.raku b/challenge-068/ash/raku/ch-1.raku
new file mode 100644
index 0000000000..2da304eab0
--- /dev/null
+++ b/challenge-068/ash/raku/ch-1.raku
@@ -0,0 +1,28 @@
+#!/usr/bin/env raku
+
+# Task 1 from
+# https://perlweeklychallenge.org/blog/perl-weekly-challenge-068/
+
+# Comments: https://andrewshitov.com/2020/07/06/raku-challenge-week-68/
+
+my @input =
+ [1, 0, 1],
+ [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;
+}
+
+say @input.join("\n");
+
+sub empty_lines(@data) {
+ grep {!all(@data[$_])}, @data.keys;
+}
+
+# Output:
+
+# 0 0 0
+# 1 0 1
+# 1 0 1