Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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:

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://473220]
[marto]: it should just be a script, pp, or on windows pp.bat, post install you should just be able to call pp -x packed.exe as the PPM package should put everything required into the appropriate path
[marto]: ah, some time ago pp became it's own package, try searching your repo for PAR::Packer
[marto]: again, Strawberry + cpanm for the win: cpanm pp to install

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2018-01-19 14:19 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (218 votes). Check out past polls.