[Belfast-pm] unshift-y bop-op-op-op, just blows me away </hair>

Andrew Wilson andrew-belfastpm at rivendale.net
Thu Dec 23 11:24:08 CST 2004


On Thu, Dec 23, 2004 at 04:58:38PM +0000, Marty Pauley wrote:
> On 2004-12-23, Andrew Wilson wrote:
> > 
> > perl -e 'do{for(0..10){print$i++%11," "}print"\n";$i--}for 0..10;'
> > 
> > But that's butt ugly,
> 
> And it doesn't work, where "work" is defined as "produce the same output as the
> original code".

perl -e 'do{for(1..10){print$i++%10+1," "}print"\n";$i--}for 0..10;'

Fixing it (for some value of fixing) just makes it uglier.  It doesn't
do what he wanted anyway (rotate a list).  I blame the spec ;-)


andrew
-- 
Scorpio: (Oct. 24 - Nov. 21)
After a lifetime of trying to be quixotic, you've only achieved a
vague sort of windmill-otic quality.


More information about the Belfast-pm mailing list