in reply to Re: Re: (Golf) Kaprekar's Process
in thread (Golf) Kaprekar's Process
The interesting thing about this is that it's not the same as right-formatting the number via sprintf, since the 0 goes to the back, but it doesn't matter because the digits are reordered anyway.sub k { $_="000"|"@_";/495/?0:1+k(-($_=join'',sort/./g)+reverse) }
MeowChow s aamecha.s a..a\u$&owag.print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: (Golf) Kaprekar's Process
by Anonymous Monk on Jun 17, 2001 at 02:49 UTC | |
by srawls (Friar) on Jun 18, 2001 at 05:19 UTC | |