From 0168c09471c0fb72a38ce50cb4a07973d41c653c Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 14 May 2009 22:47:33 -0500 Subject: less stupid solution to 19 --- 019.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/019.pl b/019.pl index b0d1cb6..47fc31a 100755 --- a/019.pl +++ b/019.pl @@ -6,7 +6,7 @@ use DateTime; my $day = DateTime->new(year => 1901, month => 1, day => 1); my $count = 0; while ($day->year < 2001) { - $count++ if $day->day_of_week == 7 && $day->day_of_month == 1; - $day->add(days => 1); + $count++ if $day->day_of_week == 7; + $day->add(months => 1); } print "$count\n"; -- cgit v1.2.3