aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2022-11-28 12:44:47 +0000
committerGitHub <noreply@github.com>2022-11-28 12:44:47 +0000
commitda34146d688d22169aeadeb4400e7f5adc653b36 (patch)
tree4374f788e3be5aaadcb470ebcf3dbcdbb6f9fbbc
parent7082a0dcb03106f4b984f4095d7da6845d27e42d (diff)
parent7f00f1338d0a204e21ce356233403be868728011 (diff)
downloadperlweeklychallenge-club-da34146d688d22169aeadeb4400e7f5adc653b36.tar.gz
perlweeklychallenge-club-da34146d688d22169aeadeb4400e7f5adc653b36.tar.bz2
perlweeklychallenge-club-da34146d688d22169aeadeb4400e7f5adc653b36.zip
Merge pull request #7171 from Scimon/master
Sometimes you just wanna use the builtins
-rw-r--r--challenge-193/simon-proctor/raku/ch-1.raku6
1 files changed, 6 insertions, 0 deletions
diff --git a/challenge-193/simon-proctor/raku/ch-1.raku b/challenge-193/simon-proctor/raku/ch-1.raku
new file mode 100644
index 0000000000..5c8ee086d2
--- /dev/null
+++ b/challenge-193/simon-proctor/raku/ch-1.raku
@@ -0,0 +1,6 @@
+#!/usr/bin/env raku
+
+#| Given a number n print all the zero padded binary strings of length n
+sub MAIN( UInt $n ) {
+ (^(2**$n)).map( { sprintf("\%0{$n}d", $_.base(2) ) } ).join(", ").say;
+}