this is so embarassing. I feel this is easy, but somehow I'm too stupid to achieve it. Needed is a subroutine, that will print letter/number indices of map quadrants. Depending on the level (zoom):
# will spill out: A1 B1 C1 D1
# will spill out A1A1 A1B1 A1C1 A1D1
# B1A1 B1B1 B1C1 B1D1
# C1A1 C1B1 C1C1 C1D1
# D1A1 D1B1 D1C1 D1D1
# should do A1A1A1 A1A1B1 A1A1C1 A1A1D1
# A1B1A1 A1B1B1 A1B1C1 A1B1D1
Any means of doing this iteratively failed miserably,
probably a recursive solution would be best, but somehow I'm failing to get a grip on the numbers:
$lvl can be anything from 1 to n, which results in
4**$lvl return values, each value consisting of $lvl
<char><digit> numbers. As you probably figured out,
chars are always [A-D] and digits [1-4].
This probably wouldn't be used for $lvl > 6, but you never know so I wanted to go for a generic solution.
Do you have any idea HowTo?
Thanks a lot,
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||