LYLOM4SPCNQX64J76E7WDGCXPJOJ2GTSLJCDREJJFZY46HGMCR3QC
YYVOTWROJFENEAQ4M4VJPWLODTTX7BTAL3NQSTL2UKJ5VSOEH4JQC
X6AJODURS3K7O6ZNPOJLXFKI73E7OBRJRMBL66UHBDKFZXK4F6RAC
73FZRRIBGT2F6MK4C2JIK4M4BXVKLF5YWRWEERBB7BZ7X4XZCWTQC
GVX7YSQYURPWFSUWVUAORZJTQBJURWWNBNUGEZYFAUMX3X5LSACQC
TRZPDEYAE6S3FP7NKTNKQLECPVV2LRKGC7PJCC2MHPXDLU7CAABQC
undo_state = u
table.insert(undo_history, u)
local undo_state = table.remove(undo_history)
undo_state = nil
undo_state = nil -- undo a single move, a list of {x=,y=,cell=} squares to write to
undo_history = {} -- an array of undo states, each an array of {x=,y=,cell=} square states.
if undo_state then
if #undo_history > 0 then
undo_history = {}