I want to make something like this:
- A1
- B1
- C1
- D1
- D2
- D3
- C2
- C3
- C1
- B2
- C4
- D10
- D11
- D12
- C5
- C6
- C4
- B3
- C7
- C8
- C9
- D25
- D26
- D27
- B1
So it's always groups of three, with every level ascending by a letter. First level is A, second B, C, D, E and so forth. The numbers are also listed in ascending order. Level A can only reach 1, B has 3, C has 9, D has 27, and so forth.
This is really easy to generate manually, converting the letters to their ASCII equivalent, adding one and converting them to character equivalent again. Problem is, I have to loop it till S, for instance, and my mind is getting messier and messier trying to put loops within loops.
What I got (toLetter and toNumber literally does what they do):
echo "<ul><li>";
echo "A1";
echo "<ul><li>";
$b = toNumber(A);
$b++;
$b = toLetter($b);
$bnum = 1 - 1;
$bnum = $bnum * 3;
$bnum++;
echo $b;
echo $bnum."</li>";
$bnum++;
echo "<li>".$b;
echo $bnum."</li>";
$bnum++;
echo "<li>".$b;
echo $bnum."</li>";
Making this:
- A1
- B1
- B2
- B3
I really can't figure out how to just loop everything so it can reach till Z.