I need to keep track of some process which goes like this
time0 = [ [0] ]
time1 = [ [ time0 ] , [1] ]
time2 = [ [ time1 ] , [2] ]
time3 = [ [ time2 ] , [3] ]
...
time5 = [ [ time4 ] , [5] ]
I do like this because:
- I need the inner objects, in a time5 object, to be dependent, so that if I modify time0, all time1 to time5 see the change;
- I create a million of those time5 objects, and my guess is that the previous process will be easy on memory;
Now, I have a hard time to access the inner element of time5.
I would hard code
time5[0][0][0][0][0][0] = 0
time5[0][0][0][0][1][0] = 1
time5[0][0][0][1][0] = 2
time5[0][0][1][0] = 3
time5[0][1][0] = 4
time5[1][0] = 5
but I need a function which will produce those index [0][0][1][0], for any arbitrary timeX object.
I don't see how to do that.
I'm also open to any design suggestion.
I suspect my idea is not the best.