diff options
| author | Mark Anderson <mark@frontrangerunner.com> | 2020-11-29 08:56:33 -0700 |
|---|---|---|
| committer | Mark Anderson <mark@frontrangerunner.com> | 2020-11-29 08:56:33 -0700 |
| commit | 5e41b39b994e82a3089d9344b5170118f86220e4 (patch) | |
| tree | eaf87042d0f99cb2b30f19d646e565e574a8e43d | |
| parent | 99d5e965cda6c47e880d6f7ec86737811195b2de (diff) | |
| download | perlweeklychallenge-club-5e41b39b994e82a3089d9344b5170118f86220e4.tar.gz perlweeklychallenge-club-5e41b39b994e82a3089d9344b5170118f86220e4.tar.bz2 perlweeklychallenge-club-5e41b39b994e82a3089d9344b5170118f86220e4.zip | |
minor touch-up
| -rw-r--r-- | challenge-088/mark-anderson/raku/ch-2.p6 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/challenge-088/mark-anderson/raku/ch-2.p6 b/challenge-088/mark-anderson/raku/ch-2.p6 index 23a4269fd5..dbdce0bc95 100644 --- a/challenge-088/mark-anderson/raku/ch-2.p6 +++ b/challenge-088/mark-anderson/raku/ch-2.p6 @@ -28,8 +28,8 @@ cmp-ok spiral(@matrix), &[eqv], [1, 2, 4, 6, 8, 7, 5, 3], "Rows > Cols"; cmp-ok spiral(@matrix), &[eqv], [1, 2, 3, 4, 8, 7, 6, 5], "Cols > Rows"; # -# Abandoning my atrocious solution and going with the -# method used by James Smith, Feng Chang, (and possibly others) +# Abandoning my atrocious solution and going with the algorithm +# implemented by James Smith, Feng Chang, (and possibly others). # sub spiral(@matrix) { my @r; @@ -37,11 +37,11 @@ sub spiral(@matrix) { while @matrix { @r.append: |@matrix.shift; - try {@r.push: .pop} for @matrix; + try { @r.push: .pop } for @matrix; try @r.append: $_ given @matrix.pop.reverse; - try {@r.push: @matrix[$_].shift} for @matrix.end...0; + try -> $i { @r.push: .[$i].shift } for .end...0 given @matrix; } @r; |
