Last fridays of the year

Author: TimToady

Write a program or a script that returns the last Fridays of each month of a given year. The year may be given through any simple input method in your language (command line, std in, etc.).


Features used

The MAIN sub -

Date objects -

Source code:

use v6;

sub MAIN (Int $year = {
    my @fri;
    for"$year-01-01") .."$year-12-31") {
        @fri[.month] = .Str if .day-of-week == 5;
    .say for @fri[1..12];