aboutsummaryrefslogtreecommitdiff
path: root/challenge-013/ozzy/perl6/ch-1.p6
blob: 3eb8130330473996dc2105c661c4fe5c328af230 (plain)
1
2
3
4
5
6
7
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) );
}