diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-05-14 22:47:33 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-05-14 22:47:33 -0500 |
commit | 0168c09471c0fb72a38ce50cb4a07973d41c653c (patch) | |
tree | f787c7de73a7fbd607f93d770996b83f5d8ab51c | |
parent | 5483c6cec2561dd79e9a42f6ff059b69d8f5ccad (diff) | |
download | projecteuler-0168c09471c0fb72a38ce50cb4a07973d41c653c.tar.gz projecteuler-0168c09471c0fb72a38ce50cb4a07973d41c653c.zip |
less stupid solution to 19
-rwxr-xr-x | 019.pl | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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"; |