Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Calculate each year's Rakudo releases
also fill up the dates for 2013.
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| use v6; | ||
|
|
||
| constant release-number-offset = 2010; | ||
| my @first-rn = ( | ||
| 25, # 2010 | ||
| 37, # 2011 | ||
| 48, # 2012 | ||
| 60, # 2013 | ||
| ); | ||
|
|
||
| sub MAIN ($year = Date.today.year) { | ||
| if $year < 2010 { | ||
| die "No support for pre-historic release dates"; | ||
| } | ||
| my $first-rn = @first-rn[release-number-offset - $year] | ||
| // 12 * ($year - @first-rn - release-number-offset + 1) + @first-rn[*-1]; | ||
| for 1..12 -> $month { | ||
| my $d = Date.new($year, $month, 1); | ||
| ++$d until $d.day-of-week == 2; # $d is now first Tuesday | ||
| $d += 14; # ... third Tuesday | ||
| $d += 2; # the release is on Thursday | ||
| say " $d Rakudo #", $first-rn + $month - 1; | ||
| } | ||
| } |