Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Alpha base-26 to base-10...

by Util (Priest)
on Jul 02, 2003 at 01:35 UTC ( #270684=note: print w/replies, xml ) Need Help??


in reply to Alpha base-26 to base-10...

Yet another take. Clear and elegant, but quite inefficient given large maximums.

{ my $count; my %h = map {$_ => ++$count} 'a'..'zzz'; sub alphabetic_to_base10 { return $h{ lc( $_[0] ) } or die; } }

Replies are listed 'Best First'.
Re^2: Alpha base-26 to base-10...
by Aristotle (Chancellor) on Jul 02, 2003 at 07:51 UTC
    That's simply a pre-memoized version of BrowserUk's approach.

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://270684]
help
Chatterbox?
[Corion]: Hmm - the longer I work, the more such sentences I collect:
[Corion]: "If I wanted to work with people, I would have become a coroner."
[Corion]: "If I wanted to work with hot air, I would have become a baloonist"
[Corion]: "If I wanted to work with flaps, I would have become a mailman"
[Corion]: (I'm not sure if the last one works in English too ;) )

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2017-09-21 14:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (248 votes). Check out past polls.

    Notices?