Easily access an array based on its dimensions
Let's say I have an array that has n dimensions. Now, to access a slot, you usually use:
array [1][0]
What to do if the number of dimensions is unknown at compile time, is there any simple access like:
slot = "1,0"
array [slot] // accessing 1,0
This means I can also navigate back and forth easily
slot += ",2"
array [slot] // accessing 1,0,2
Any such way to access any slot in a multi-character array in one line of code, in ActionScript? I'm not looking for alternative code that does this indirectly (recursive functions or loops).
In JavaScript, you can:
slot = "1,0"
eval("array[" + slot + "]") // accessing 1,0
0
a source to share