Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: [golf] Kaprekar Numbers

by truedfx (Monk)
on Jul 07, 2005 at 20:36 UTC ( #473220=note: print w/replies, xml ) Need Help??


in reply to Re: [golf] Kaprekar Numbers
in thread [golf] Kaprekar Numbers

Based on your idea, I got it to 38:
# 34567890123456789012345678901234567890 $_=$_[0]**2;pos=y///c/2;//g;$`+$'==pop
(Edit: and using thospel's "@_" instead of $_[0] makes it 37. I wonder how I managed to miss that...)

Replies are listed 'Best First'.
Re^3: [golf] Kaprekar Numbers
by thospel (Hermit) on Jul 08, 2005 at 18:51 UTC
    Like this it's 34:
    (pos=$_="@_"**2)/=2;//g;$`+$'==pop

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://473220]
help
Chatterbox?
[shmem]: Corion: very clear case of missing sequence number
[Corion]: shmem: Yeah. I guess they have a sequence number but distribute the events across threads or machines or whatever.
[karlgoethebier]: choroba: another chapter of "Learning English At The Monastry"?
[shmem]: Corion, well then... next issue, sequence number not a shared resource :P
[Discipulus]: shmem i'm searching it.. but failing i was sure was in Re: Let's Make PerlMonks Great Again! -- suggestions and dreams
erix recommends Vanished Kingdoms
[Corion]: shmem: Yeah, something like that. Not that that would be a solved issue. Simply process all events that come in from a single interface sequentially. Ah well.
[Discipulus]: their

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2017-05-23 08:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?