aboutsummaryrefslogtreecommitdiff
path: root/challenge-059
diff options
context:
space:
mode:
authorSimon Proctor <simon.proctor@zoopla.co.uk>2020-05-04 10:05:06 +0100
committerSimon Proctor <simon.proctor@zoopla.co.uk>2020-05-04 10:05:06 +0100
commita90dbb2e870a8c05e561017ff001454842ffcce2 (patch)
treecee41164e651cf59738c22b961cba75b1667b38e /challenge-059
parent4b68761f4e70df055e849a1cb9c6095fea4bbf3b (diff)
downloadperlweeklychallenge-club-a90dbb2e870a8c05e561017ff001454842ffcce2.tar.gz
perlweeklychallenge-club-a90dbb2e870a8c05e561017ff001454842ffcce2.tar.bz2
perlweeklychallenge-club-a90dbb2e870a8c05e561017ff001454842ffcce2.zip
Finally work out which bit of bit shifting I need
Diffstat (limited to 'challenge-059')
-rw-r--r--challenge-059/simon-proctor/raku/ch-2.raku2
1 files changed, 1 insertions, 1 deletions
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 ) }