in reply to Symmetrical Date Golf
Update: Changed || to && as per metadoktor's note. This fixes the bug found.# This is 165 characters for(grep{/(..)(..)/;$1<24&&$2<60}map{sprintf"%04d",$_}0..2359){($t=$_) +=~s/(..)(..)/$1:$2/;$y=reverse;print map{"$t\t$_\t$y\n"}qw(10/01 20/0 +2 30/03 01/10 11/11 21/12)} ---- # This is 164 characters map{($t=$_)=~s/(..)(..)/$1:$2/;$y=reverse;print map{"$t\t$_\t$y\n"}qw( +10/01 20/02 30/03 01/10 11/11 21/12)}grep{/(..)(..)/;$1<24&&$2<60}map +{sprintf"%04d",$_}0..2359
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Symmetrical Date Golf
by metadoktor (Hermit) on Feb 28, 2002 at 16:38 UTC |