aboutsummaryrefslogtreecommitdiff
path: root/challenge-052/mohammad-anwar/raku/ch-1.p6
blob: 3623fe30772e1f5c5f0017a75e8226f66e8f5caf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env perl6

use v6.c;

sub MAIN(Int $start is copy = 100, Int $stop = 999) {

    die "ERROR: Invalid start [$start]." if $start < 100;
    die "ERROR: Invalid stop [$stop]."   if $stop  > 999 || $stop < $start;

    while $start <= $stop {
        say $start if ([==] $start.comb("") Z- <0 1 2>)
                      ||
                      ([==] $start.comb("") Z- <2 1 0>);
        $start++;
    }
}