From 2cd039282886786a56848441be3edff519e70da0 Mon Sep 17 00:00:00 2001 From: Mark <53903062+andemark@users.noreply.github.com> Date: Wed, 21 Feb 2024 20:19:33 +0000 Subject: ch-2.raku final final :) --- challenge-257/mark-anderson/raku/ch-2.raku | 6 +++--- 1 file 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 } -- cgit