aemkei/aemkei.github.io — pull request #14 by rlauck (2013-11-27 04:44:52+00:00)
Title: Had it down to 303 until I found a bug...

To see the bug - look in master or my older commit 31fac9a and try creating a formula chain in reverse reading order such as:

A1: =A2
A2: =A3
A3: =A4
...

Stashing the calculated value in t then reading using "with(t)" means that we only resolve the first level of a chain of formula calls if they are not all fully resolved in left to right, top to bottom reading order. This may be an acceptable limitation, but I feel most spreadsheets users would consider it broken.

I went back to treating cell values as function calls based on some of my previous commits because it allows for formula chains as large as the stack. We could instead brute force it by adding an outer for loop that iterates the inner loops in A() by the total number of cells (9*5) and we could probably even get away with fewer iterations and still fool most users but it just felt wrong :-P