From a0be6e85851b6da6425765237d1096704c2b55df Mon Sep 17 00:00:00 2001 From: "E. Choroba" Date: Fri, 8 May 2020 00:33:12 +0200 Subject: Add link to E. Choroba's blog post about 059: Linked List + Bit Sum Simplify the code according to the blog post, too. --- challenge-059/e-choroba/blog.txt | 1 + challenge-059/e-choroba/perl/ch-2.pl | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 challenge-059/e-choroba/blog.txt (limited to 'challenge-059') diff --git a/challenge-059/e-choroba/blog.txt b/challenge-059/e-choroba/blog.txt new file mode 100644 index 0000000000..7692d6072b --- /dev/null +++ b/challenge-059/e-choroba/blog.txt @@ -0,0 +1 @@ +http://blogs.perl.org/users/e_choroba/2020/05/perl-weekly-challenge-059-linked-list-and-bit-sum.html diff --git a/challenge-059/e-choroba/perl/ch-2.pl b/challenge-059/e-choroba/perl/ch-2.pl index f9cde1626c..5a8e182b01 100755 --- a/challenge-059/e-choroba/perl/ch-2.pl +++ b/challenge-059/e-choroba/perl/ch-2.pl @@ -4,8 +4,7 @@ use strict; sub diff_bits { my ($x, $y) = @_; - my ($bx, $by) = map { pack 'N', $_ } $x, $y; - return unpack '%32b*', $bx ^ $by + return unpack '%32b*', pack 'N', $x ^ $y } sub chain_diff_bits { -- cgit