Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: dynamic map "quadrant" indexing

by Anonymous Monk
on Aug 14, 2005 at 13:42 UTC ( #483692=note: print w/replies, xml ) Need Help??


in reply to Re: dynamic map "quadrant" indexing
in thread dynamic map "quadrant" indexing

Uhm... well forget it, the code is crap. This one does the right thing:
sub idx { my $lvl = shift; # ARG1: get level my @out = qw(a1 b1 c1 d1 a2 b2 c2 d2 a3 b3 c3 d3 a4 b4 c4 d4); # init OUT array return \@out if($lvl == 1); # bail out if lvl = 1 my @tmp; for my $o (@out) { push @tmp, map { "$o$_" } @{&idx($lvl-1)}; } return \@tmp; }
Probably I should not do my coding sunday morning. Marcel

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://483692]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2020-05-27 02:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (152 votes). Check out past polls.

    Notices?