in reply to Alpha base-26 to base-10...
Feel free to not use the name:)
sub b262b10{ my ($n,$x)=(0,'A'); ++$n until $x++ eq $_[0]; ++$n } print $_, ':', b262b10( $_ ), $/ for qw[A Z AA AZ BA ZZ AAA ZBA] A : 1 Z : 26 AA : 27 AZ : 52 BA : 53 ZZ : 702 AAA : 703 ZBA : 17629
Update: Lest anyone not realise it, this okay as a golf solution, but it is not a serious contender for anything real as it is horribly inefficient.
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Alpha base-26 to base-10... (golf)
by sauoq (Abbot) on Jul 01, 2003 at 03:48 UTC | |
by bwana147 (Pilgrim) on Jul 01, 2003 at 10:46 UTC | |
by John M. Dlugosz (Monsignor) on Jul 01, 2003 at 15:36 UTC | |
by Tomte (Priest) on Jul 01, 2003 at 16:10 UTC | |
by John M. Dlugosz (Monsignor) on Jul 01, 2003 at 18:04 UTC | |
|
In Section
Seekers of Perl Wisdom