in reply to Golfing the day of Christmas
in thread Christmas Coding Blues
Are you guys using another version of perl than I am? At least here, the !-operator binds more tightly than the %-operator, so that (!$_%4 &c) just won't work.
... or am I just giving away your joke now ... ?
Anyway, I guess this would work (checking the calendar). 65 chars; based on yours:
... or my best, so far, at 52:sub f { #234567890#234567890#234567890#234567890#234567890#234567890#234567890 +#234567890 for(1..($b=pop)++){$b++;$b--if$_%4;$b++if$_%100;$b--if$_%400}$b%7 }
sub f { #234567890#234567890#234567890#234567890#234567890#2 $b+=$_%400?$_%100?$_%4?0:1:0:1for 1..($b=pop)++;$b%7 }
Update: Checking the calendar again ...
The Sidhekin
print "Just another Perl ${\(trickster and hacker)},"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Golfing the day of Christmas
by jynx (Priest) on Dec 14, 2001 at 06:45 UTC | |
by Sidhekin (Priest) on Dec 14, 2001 at 18:46 UTC |