diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2020-11-29 18:56:18 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-29 18:56:18 +0000 |
| commit | 3739945a6bf8a2eed5ccf23dd187e95dd2799d43 (patch) | |
| tree | ad2f996393a8b5c8567c44e2ce0f6c4b159b3650 | |
| parent | 9e125d1f0a8adfaa37477b49662a741e3b12619b (diff) | |
| parent | 5e41b39b994e82a3089d9344b5170118f86220e4 (diff) | |
| download | perlweeklychallenge-club-3739945a6bf8a2eed5ccf23dd187e95dd2799d43.tar.gz perlweeklychallenge-club-3739945a6bf8a2eed5ccf23dd187e95dd2799d43.tar.bz2 perlweeklychallenge-club-3739945a6bf8a2eed5ccf23dd187e95dd2799d43.zip | |
Merge pull request #2870 from andemark/branch-for-challenge-088
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; |
