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

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

by srawls (Friar)
on Jun 17, 2001 at 00:57 UTC ( [id://89101] : note . print w/replies, xml ) Need Help??


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

Ok, I get it. I can modify yours than, and improve it by two chars:
sub a { $_=pop;s/^..$/0$&/;/495/?0:1+a(-($_=join'',sort/./g)+reverse) }

The 15 year old, freshman programmer,
Stephen Rawls