I don't know what you would call this.. I guess counting. Can anyone help?
Hey nerds, or would you guys prefer geeks?
I'm a programmer in training and have come up with a little idea which requires some math that I can't work out.
Basically, I have an array:
Code:
A = Array (
0 => 'a',
1 => 'b',
2 => 'c'
)
If you guys understand that much.. I don't know what the math terminology is for this kind of rubbish.
this is basically what it is..
A0 = a
A1 = b
A2 = c
Then here's what I'm trying to do.
I'm planning on looping through every letter in the array, then once I've ran out of letters I start with the first letter and make a double letter string. For example:
Code:
a
b
c
aa
ab
ac
ba
bb
bc
ca
cb
cc
aaa
aab
aac
aba
abb
abc
aca
acb
acc
baa
bab
bac
bba
bbb
bbc
bca
bcb
bcc
caa
cab
cac
cba
cbb
cbc
cca
ccb
ccc.. etc
Just like couting..
Code:
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20... etc
K.. well what would be the way of doing this. I'm guessing some sort of power to.
Thanks for any help.