async_automata.lua
local pattern = require('forma.pattern')
local primitives = require('forma.primitives')
local automata = require('forma.automata')
local neighbourhood = require('forma.neighbourhood')
local sq = primitives.square(10,5)
local start_point = sq:rcell() local ca_pattern = pattern.new():insert(start_point.x, start_point.y)
local moore = automata.rule(neighbourhood.moore(), "B12/S012345678")
local converged = false
while converged == false do
ca_pattern, converged = automata.async_iterate(ca_pattern, sq, {moore})
end
local symmetrised_pattern = ca_pattern:hreflect()
symmetrised_pattern = symmetrised_pattern:vreflect():vreflect()
symmetrised_pattern = symmetrised_pattern:hreflect():hreflect()
local vn = neighbourhood.von_neumann()
symmetrised_pattern:neighbourhood_categories(vn)
:print(vn:category_label())