Ha! That is so cool. I was super interested in the idea so tried doing it myself without looking at your solution and came up with a quite an elegant solution using only 8 formulas
and some named ranges (could be 4 if you inlined them more but I kept them separate for clarity).
Thanks, I really enjoyed this. It brings me back to my Digital Logic Design class where we needed to construct the truth tables for a digital clock for our final exam.
They've always (?) had a script IDE you can use to create your own functions for use in cells so I guess it has always been Turing complete.
I've used the script IDE a lot where it just made sense to do something in about 10 lines/a for-loop of normal procedural code rather than an unreadable chain of about 50 spreadsheet formulas in one cells.
https://docs.google.com/spreadsheets/d/1T3bv8ThluHc18ghI8u9m...
Thank you for the inspiration!