Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

garth (867)

garth
  (email not shown publicly)

Journal of garth (867)

Saturday February 02, 2002
03:56 AM

Golf

[ #2597 ]

As I was watching bits of the golf on TV this afternoon, I read about the golf challenge in the Perl Review mag, and thought I would give it a try. My first attempt had the slight bug of it only working on one digit numbers, but undetered I solidered on.

I think my latest attempt actually works correctly, but has 74 characters:

for(split //,reverse shift){$c+=(ord()-(/\d/?48:55))*(36**$p++);}print $c;

After looking at some of the other solutions, it would seem I need to get out the camel and read up on map and y///, as I am not really sure how these work. Who would of thought converting different base numbers could actually be fun and educational :-)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.