From 241b8ba8a74f88f411c4d09b96cd81af948d979c Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 28 Nov 2022 08:58:58 +0000 Subject: Create ch-1.pl --- challenge-193/james-smith/perl/ch-1.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 challenge-193/james-smith/perl/ch-1.pl diff --git a/challenge-193/james-smith/perl/ch-1.pl b/challenge-193/james-smith/perl/ch-1.pl new file mode 100644 index 0000000000..28da54e4e6 --- /dev/null +++ b/challenge-193/james-smith/perl/ch-1.pl @@ -0,0 +1,13 @@ +#!/usr/local/bin/perl + +use strict; + +use warnings; +use feature qw(say); + +say join ', ', binary($_) for 1..10; + +sub binary { + my $t = "%0$_[0]b"; + map { sprintf $t, $_ } 0.. (1<<$_[0])-1 +} -- cgit