aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Krňávek <Jan.Krnavek@gmail.com>2020-11-25 22:05:29 +0100
committerJan Krňávek <Jan.Krnavek@gmail.com>2020-11-25 22:05:29 +0100
commit5f363976fa1c512469470084da32d81bf218e9fc (patch)
tree3cf006b4835095e2fd1a593bf1195948786523d2
parentbde6a78552a496d054be296383ac0bdbcb2ae722 (diff)
downloadperlweeklychallenge-club-5f363976fa1c512469470084da32d81bf218e9fc.tar.gz
perlweeklychallenge-club-5f363976fa1c512469470084da32d81bf218e9fc.tar.bz2
perlweeklychallenge-club-5f363976fa1c512469470084da32d81bf218e9fc.zip
solution week 088-2 — now works is-deeply tests for spiral-matrix
-rw-r--r--challenge-088/wambash/raku/ch-2.raku6
1 files changed, 3 insertions, 3 deletions
diff --git a/challenge-088/wambash/raku/ch-2.raku b/challenge-088/wambash/raku/ch-2.raku
index 9d21ad30e5..bce07d29b6 100644
--- a/challenge-088/wambash/raku/ch-2.raku
+++ b/challenge-088/wambash/raku/ch-2.raku
@@ -14,7 +14,7 @@ sub rotate-left (+@n) {
sub spiral-matrix (+@n) {
\( matrix => @n, spiral => Empty ), { \( matrix => .<matrix>.skip.&rotate-left, spiral => .<matrix>.head ) } ... !*.<matrix>
- andthen .map: *.<spiral>
+ andthen .map: |*.<spiral>
}
multi MAIN (Bool :$test!) {
@@ -38,6 +38,6 @@ multi MAIN (Bool :$test!) {
);
is-deeply rotate-left(@matrix), $rotated;
- is spiral-matrix(@matrix), (1, 2, 3, 6, 9, 8, 7, 4, 5);
- is spiral-matrix(@matrix2), (1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10);
+ is-deeply spiral-matrix(@matrix), (1, 2, 3, 6, 9, 8, 7, 4, 5);
+ is-deeply spiral-matrix(@matrix2), (1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10);
}