Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: TIMTOWTDI/golf - counting backwards

by broquaint (Abbot)
on Jan 28, 2002 at 20:23 UTC ( #142092=note: print w/replies, xml ) Need Help??


in reply to TIMTOWTDI/golf - counting backwards

I've got
sub f { ($x,$y)=@_;print$x--while$x>=$y }
So that's a hole in 32, although it only works for numbers, so it's not a literal implementation of .. reversed.

broquaint

Update: I may have misunderstood the original question so here's my second (possibly more accurate?) shot

perl -le '$_=ord$/;print$_--while$_'
Which comes to 26, and satisfies chipmunk's need for ouput :o)

Update 2: I've just noticed my solution is exactly the same aforementioned monk, except I've used $_ instead of $a as my var name (I had hoped to exploit $_ in some way ...). Spooky.

Replies are listed 'Best First'.
Re: Re: TIMTOWTDI/golf - counting backwards
by chipmunk (Parson) on Jan 28, 2002 at 21:01 UTC
    I tried running your solution, but it didn't produce any output...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://142092]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2019-06-24 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (100 votes). Check out past polls.

    Notices?