aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2019-06-17 14:34:47 +0100
committerGitHub <noreply@github.com>2019-06-17 14:34:47 +0100
commit13fe7935be7c9068467427684afa2d72ac3f1b8c (patch)
tree8d086ddda2c2a84d8ff8086a411858fc9b236698
parent487570e2109b3562e5c8bbe3f5a46db888e9452f (diff)
parentdd179ae22ed7bfba6fbadbfad7f3f8cdb80b29e5 (diff)
downloadperlweeklychallenge-club-13fe7935be7c9068467427684afa2d72ac3f1b8c.tar.gz
perlweeklychallenge-club-13fe7935be7c9068467427684afa2d72ac3f1b8c.tar.bz2
perlweeklychallenge-club-13fe7935be7c9068467427684afa2d72ac3f1b8c.zip
Merge pull request #268 from Scimon/master
Ooops
-rw-r--r--challenge-013/simon-proctor/perl6/ch-1.p66
1 files changed, 5 insertions, 1 deletions
diff --git a/challenge-013/simon-proctor/perl6/ch-1.p6 b/challenge-013/simon-proctor/perl6/ch-1.p6
index 4ae432f3a2..2afdf0dbaf 100644
--- a/challenge-013/simon-proctor/perl6/ch-1.p6
+++ b/challenge-013/simon-proctor/perl6/ch-1.p6
@@ -8,5 +8,9 @@ sub date-format( $date ) { sprintf "%04d/%02d/%02d", .year, .month, .day given $
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);
+ say( date-format( $_ ) ) for (Date.new( :$year, :1month, :1day )...Date.new( :$year, :12month, :31day ))
+ .grep( *.day-of-week() == 5)
+ .sort( { $^b <=> $^a } )
+ .grep( { state $m = 13; if ( $_.month < $m ) { $m = $_.month;True } else { False } })
+ .sort( * <=> * );
} \ No newline at end of file