diff options
| -rw-r--r-- | challenge-227/simon-proctor/raku/ch-1.raku | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-227/simon-proctor/raku/ch-1.raku b/challenge-227/simon-proctor/raku/ch-1.raku new file mode 100644 index 0000000000..4cfb804d05 --- /dev/null +++ b/challenge-227/simon-proctor/raku/ch-1.raku @@ -0,0 +1,12 @@ +#!/usr/bin/env raku + +#| Given a year between 1753 and 9999 print the number of friday the 13ths +sub MAIN( + Int() $year where 1753 <= * <= 9999 #= Year between 1753 and 9999 +) { + (1..12) + .map( -> $m { Date.new($year,$m,13) } ) + .grep( -> $d { $d.day-of-week == 5 } ) + .elems + .say; +} |
