diff options
| -rwxr-xr-x | challenge-007/simon-proctor/perl6/ch-1.p6 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/challenge-007/simon-proctor/perl6/ch-1.p6 b/challenge-007/simon-proctor/perl6/ch-1.p6 new file mode 100755 index 0000000000..f2ff5cf134 --- /dev/null +++ b/challenge-007/simon-proctor/perl6/ch-1.p6 @@ -0,0 +1,13 @@ +#!/usr/bin/env perl6 + +use v6; + +multi sub is-niven( 0 ) { False } + +multi sub is-niven( Int $num where * > 0 ) { + $num %% [+] $num.comb; +} + +sub MAIN( UInt() $max=50 ) { + .say if is-niven($_) for 0..$max; +} |
