Open zach-r-hughes opened 2 years ago
Without a memory cell/array (a stack), function calls may be implementable if two functions 'A' and 'B' are called in such a way that 'A' calls 'B', but 'B' never calls 'A' (in the same context).
Another potential, memory-cell less implementation would be to pre-allocate a massive amount of memory on program start, and write a index radix-style address reduction algorithm that with 4 iterations could allow up to 1000 elements. This would potentially increase the start-up time of the program, though, as many, many variables would have to be allocated, and a massive ugly 'if' statement would need to be implemented that would reduce to the correct array element.
If there were some way to read/manipulate the characters from a string, there may be some opportunity there for an array-like data structure. It doesn't appear however that there is such functionality in vanilla Mindustry.
Currently, recursive functions are not implemented. An array may be required for implementation, which would potentially require a memory cell for the program to execute correctly.