diff options
Diffstat (limited to 'challenge-013')
| -rw-r--r-- | challenge-013/ozzy/perl6/ch-1.p6 | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/challenge-013/ozzy/perl6/ch-1.p6 b/challenge-013/ozzy/perl6/ch-1.p6 new file mode 100644 index 0000000000..3eb8130330 --- /dev/null +++ b/challenge-013/ozzy/perl6/ch-1.p6 @@ -0,0 +1,8 @@ +!/usr/bin/env perl6 +# Print the last Fridays of the month for a given year. + +sub MAIN ( Int $year ) +{ + .say for grep { .day-of-week == 5 && (.days-in-month - .day < 7 ) }, + (Date.new($year, 1, 1) ... Date.new($year, 12, 31) ); +} |
