in reply to Base36 numbers: speed and golf
sub addone{ # 1 2 3 4 5 6 #23456789_123456789_123456789_123456789_123456789_123456789_123456789 ($_,$s)=@_;y/A-Z/:-T/;$s=36*$s-48+ord for/./g;$s++;$t.=chr(($s%36)+48 # 8 9 10 11 12 #23456789_123456789_123456789_123456789_123456789_12 ),$s=($s-$s%36)/36while$s>0;$t=~y/:-T/A-Z/;reverse$t }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Base36 numbers: speed and golf
by Anonymous Monk on Feb 27, 2002 at 23:07 UTC | |
by Anonymous Monk on Feb 27, 2002 at 23:31 UTC | |
by dws (Chancellor) on Feb 28, 2002 at 00:16 UTC | |
by zengargoyle (Deacon) on Feb 27, 2002 at 23:25 UTC |