Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Re: (Golf) Kaprekar's Process

by mr.nick (Chaplain)
on Jun 17, 2001 at 03:35 UTC ( #89112=note: print w/replies, xml ) Need Help??


in reply to Re: Re: (Golf) Kaprekar's Process
in thread (Golf) Kaprekar's Process

And I can take it down a litter further massaging your code into this:
sub g{ # 1 2 3 4 5 6 + 7 # 12345678901234567890123456789012345678901234567890123456789012345678 +9012 return$,if($_=pop)==495;$_=join'',sort split//,$_;$,++;g((reverse)-$ +_) }
But I can't do one on my own... my own solution came in at 83 :(

mr.nick ...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://89112]
help
Chatterbox?
[Corion]: I found plenty of not chatty enough logs with Perl too ... I'm slowly coming to appreciate Log::Log4perl resp. our homegrown alternative
[tye]: my experience with python so far is more like finding a moderately useful error message is a shocking surprise.
Corion disappears
[tye]: I get an error string but no reason and no context. Like die "Could not read file.\n" but with a stack trace where all of the useful context is stripped.
[thezip]: Heya tye!
[tye]: hey, thezip!

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2017-09-21 20:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (252 votes). Check out past polls.

    Notices?