From 7f00f1338d0a204e21ce356233403be868728011 Mon Sep 17 00:00:00 2001 From: Scimon Date: Mon, 28 Nov 2022 09:26:57 +0000 Subject: Sometimes you just wanna use the builtins --- challenge-193/simon-proctor/raku/ch-1.raku | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 challenge-193/simon-proctor/raku/ch-1.raku 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; +} -- cgit