diff options
| -rw-r--r-- | challenge-013/simon-proctor/perl6/ch-1.p6 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-013/simon-proctor/perl6/ch-1.p6 b/challenge-013/simon-proctor/perl6/ch-1.p6 new file mode 100644 index 0000000000..4ae432f3a2 --- /dev/null +++ b/challenge-013/simon-proctor/perl6/ch-1.p6 @@ -0,0 +1,12 @@ +#!/usr/bin/env perl6 + +use v6; + +sub date-format( $date ) { sprintf "%04d/%02d/%02d", .year, .month, .day given $date ; } + +#| Print a list of every friday in the given year +sub MAIN ( + Int() $year #= Year to list Fridays for. +) { + say( date-format( $_ ) ) for (Date.new( :$year, :1month, :1day, formatter => &date-format )...Date.new( :$year, :12month, :31day, formatter => &date-format )).grep( *.day-of-week() == 5); +}
\ No newline at end of file |
