aboutsummaryrefslogtreecommitdiff
path: root/challenge-002/stuart-little/raku/ch-2.p6
blob: f558902ca97163e8301278d3f6e48cec33264e9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env perl6
use v6;

my %*SUB-MAIN-OPTS=:named-anywhere,;
sub MAIN(    
    Bool :f(:$from-base_35),
    Bool :t(:$to-base_35) = ! $from-base_35,
    *@ARGS,
    ) {
    my &cvrt=($from-base_35) ?? ({ $_.parse-base(35) }) !! ({ $_.Int.base(35) });
    say @ARGS[0].&cvrt;
}