aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKUEPPO <tcheukueppo@tutanota.com>2022-11-26 13:30:14 +0100
committerGitHub <noreply@github.com>2022-11-26 13:30:14 +0100
commit4cfd8a9c7cea395bc193516a6c33572c5797dbfc (patch)
tree147b21ce40edb53880531c23f3b76d9ffef63586
parentfca8a2f283e4bcc5102a01446383978257bc6937 (diff)
downloadperlweeklychallenge-club-4cfd8a9c7cea395bc193516a6c33572c5797dbfc.tar.gz
perlweeklychallenge-club-4cfd8a9c7cea395bc193516a6c33572c5797dbfc.tar.bz2
perlweeklychallenge-club-4cfd8a9c7cea395bc193516a6c33572c5797dbfc.zip
ch-1.pl
-rw-r--r--challenge-192/kueppo-wesley/Perl/ch-1.pl15
1 files changed, 15 insertions, 0 deletions
diff --git a/challenge-192/kueppo-wesley/Perl/ch-1.pl b/challenge-192/kueppo-wesley/Perl/ch-1.pl
new file mode 100644
index 0000000000..ad3725237b
--- /dev/null
+++ b/challenge-192/kueppo-wesley/Perl/ch-1.pl
@@ -0,0 +1,15 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+sub flip {
+ my $bin = "0b" . ( sprintf "%b", shift ) =~ tr[01][10]r;
+ return oct $bin;
+}
+
+is_deeply( [ map { flip($_) } qw/ 5 4 6 / ], [ 2, 3, 1 ], "well fliped?" );
+
+done_testing(1);