in reply to Re: Luhn Number Golf
in thread Luhn Number Golf
++.
You can eliminate reverse and shorten it to 55.
and, if you don't care for strict-ness, shave another 5 chars, by eliminating my$s;sub luhn { # 1 2 3 4 5 #234567890123456789012345678901234567890123456789012345 my$s;$_=pop;~s/(.)(.)/$2.$1*2/ge;$s+=$_ for/./g;!chop$s }
/prakash
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Luhn Number Golf
by chipmunk (Parson) on Feb 26, 2002 at 22:15 UTC | |
by blakem (Monsignor) on Mar 08, 2002 at 09:10 UTC |
In Section
Meditations