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