I've just uploaded a C file that works with 64 bits (though it can be anything) and provides a skeleton for the data shuffling that reduces memory usage.
There is no double-buffering, the cells are computated "in place". To prevent time-distorsions (the result being directly used for the next iteration), the current result is written to the WriteBuffer variable. This variable is then written back to memory after the past value is read (again).
To emulate "some sort of expanding computation", I have used the following simple formula :
WriteBuffer = L1+L2+L3;
This helps me check that the ranges of indices can be dynamically adjusted. For example, with the following initial configuration:
After a few cycles, the range has grown :
It is important to keep an empty line before first line and after the last line, so more cells can grow there.
The adjustment of the last line is done with the variable run: it is first cleared to 0 then set to the line number where the line is not empty. This value is then assigned at the end of the scan:
MaxLine will be the upper limit for the next time step, but it should preserve the previously mentioned "margin" for the growth of new cells beyond the last line. That's why run is set with a little offset, inside the loop:
Dealing with the start index is a bit more tricky but run provides us with a way to handle it nicely. It remains stuck to 0 while empty lines are found so we can increase MinLine as long as run is cleared. The complete code is simply:
run=i+2; // push the end of the work range
if (run==0) // no life found yet
MinLine=i-1; // push the start of the work range
Overall, it's a bit delicate but not totally arcane, since it's only a 1D array. I keep it simple because a 2D array has some very tricky side effects. The AMBAP is limited to 16-bits wide data anyway, for computation AND display.