This may seem strange, but, I need an idea on how to read a one dimensional array as one which is 3-d and toroid (doughnut like).
This starts with my "Game of life" patch in the #pixel forum, which I now realize is flawed.
I have a table, say 32 points, which I 'fold' to represent an array which is 8X4. Now, I can read the array as a three dimensional one with some pretty simple counters. The process of Conway's game requires me to find the sum of all neighboring cells, or points, which have boolean values. So, if I am interested in updating the status of cell whose location in the grid is 1-0, I [tabread] the table at point 8. The problem is in reading the states of the adjacent cells. If i want to read the cell 'to the right' of point 8 (n) I just increase the [tabread] index by one, giving me point 9 (n+1). Same goes for above and below, except I subtract or add the length of the row: (n-8) or (n+8) respectively. *BUT* If I need to point BEFORE cell eight, I have to wrap the counter to give me the point at the 'right end' of the row. This goes the same for cells 'above' and 'below' those in the 'top' and 'bottom' rows, and to the 'right' and 'left' of cells in the finite columns.
So I think I need some fancy math using [wrap] to spit out a list of eight positions in the array, corresponding to the eight 'neighbors' of the cell whose fate I am trying to decide. Does this make sense? Is this a good opportunity to learn PERL or PYTHON?
--Nestor(tired)