From a90dbb2e870a8c05e561017ff001454842ffcce2 Mon Sep 17 00:00:00 2001 From: Simon Proctor Date: Mon, 4 May 2020 10:05:06 +0100 Subject: Finally work out which bit of bit shifting I need --- challenge-059/simon-proctor/raku/ch-2.raku | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'challenge-059/simon-proctor') diff --git a/challenge-059/simon-proctor/raku/ch-2.raku b/challenge-059/simon-proctor/raku/ch-2.raku index 224906b720..4ed143b303 100644 --- a/challenge-059/simon-proctor/raku/ch-2.raku +++ b/challenge-059/simon-proctor/raku/ch-2.raku @@ -3,7 +3,7 @@ use v6; multi sub bit-diff( UInt $a, UInt $b where $a >= $b ) { - [+] ($a.base(2).comb.reverse Z (|$b.base(2).comb.reverse, |(lazy gather { take 0 }) ) ).map( { abs( $^a[0] - $^a[1] ) } ); + [+] ($a +^ $b).base(2).comb; } multi sub bit-diff( UInt $a, UInt $b ) { bit-diff( $b, $a ) } -- cgit