aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-052/simon-proctor/raku/ch-1.p616
1 files changed, 16 insertions, 0 deletions
diff --git a/challenge-052/simon-proctor/raku/ch-1.p6 b/challenge-052/simon-proctor/raku/ch-1.p6
new file mode 100644
index 0000000000..f3166b957d
--- /dev/null
+++ b/challenge-052/simon-proctor/raku/ch-1.p6
@@ -0,0 +1,16 @@
+#!/usr/bin/env raku
+
+use v6;
+
+sub is-consecutive( UInt $number ) {
+ my @test = $number.comb();
+ [==] ((@test.elems,*-1...0) Z+ @test)
+}
+
+#| Give all the stepping mnumbers between start and end
+sub MAIN (
+ UInt $start where { $_ >= 100 } = 100, # Start value defaults to 100
+ UInt $end where { $_ >= $start } = 999, # End value default to 999
+) {
+ .say for ($start..$end).hyper.grep( &is-consecutive )
+}