aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);