Henry Zweiman — nine-color square-lattice construction

Substitution: h(0)=012, h(1)=02, h(2)=1.
W = lim h^(2n)(1) | h^(2n)(0), with index 0 immediately right of the bar.
The left blocks are nested suffixes and the right blocks are nested prefixes.
Use A(i)=C(i)=W(i+100).

B(3j)=3; B(3j+1)=C(2j+1); B(3j+2)=C(2j+2).
m_j=3-C(2j+1)-C(2j+2), the missing ternary symbol.

For odd x+y:
  u=(x+y-1)/2
  c(x,y)=1+2B(u)+(x mod 2).

For even x+y:
  s=(x-y)/2; t=(x+y)/2; j=floor((t-1)/3).
  c(x,y)=0 if A(s)=0, otherwise 2m_j+A(s).

All remainders are nonnegative. Division uses floor rounding for negative values.
Colors are the integers 0 through 8. The website palette only changes their appearance.

Run with Python 3:
  python3 build_lattice.py --output lattice-nine.json

The supplied rendering is 144 columns by 100 rows, with origin (-72,-50).
Column index increases x; screen row index increases y. It is a finite window of
this rule, not a periodically tiled image. The renderer crops the window to fit.

This package specifies and reproduces the construction. It does not include a
proof that all finite simple paths in the infinite lattice are nonrepetitive.
