diff options
| author | Mark <53903062+andemark@users.noreply.github.com> | 2024-02-21 20:19:33 +0000 |
|---|---|---|
| committer | Mark <53903062+andemark@users.noreply.github.com> | 2024-02-21 20:19:33 +0000 |
| commit | 2cd039282886786a56848441be3edff519e70da0 (patch) | |
| tree | 12c3f29570dcac1e40cd407ab2ce7ba2bcd0e3d1 | |
| parent | 941a18cfc57a329f18399109c26022f06a0be161 (diff) | |
| download | perlweeklychallenge-club-2cd039282886786a56848441be3edff519e70da0.tar.gz perlweeklychallenge-club-2cd039282886786a56848441be3edff519e70da0.tar.bz2 perlweeklychallenge-club-2cd039282886786a56848441be3edff519e70da0.zip | |
ch-2.raku final final :)
| -rw-r--r-- | challenge-257/mark-anderson/raku/ch-2.raku | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/challenge-257/mark-anderson/raku/ch-2.raku b/challenge-257/mark-anderson/raku/ch-2.raku index f772c06ebd..f61ebc906a 100644 --- a/challenge-257/mark-anderson/raku/ch-2.raku +++ b/challenge-257/mark-anderson/raku/ch-2.raku @@ -65,7 +65,7 @@ sub reduced-row-echelon(+@m) # rows with all zeroes are grouped at the bottom with $k { - return False unless all(@pivots[$k..*]) ~~ Any; + return False unless all(@pivots[$k..*]) eqv Any; @pivots = @pivots[^$k]; return True unless @pivots } @@ -81,8 +81,8 @@ sub reduced-row-echelon(+@m) # @m should be an identity matrix at this point if it is RREF # all pivots are ones - return False unless squish(@m.keys.map({ |@m[$_].splice($_,1) })) ~~ (1,); + return False unless all(@m.keys.map({ |@m[$_].splice($_,1) })) == 1; # everything else is zeroes - return squish(@m[*;*]) ~~ (0,) + return all(@m[*;*]) == 0 } |
