Home

Awesome

Open in Gitpod GoDoc

quadtree

Go implementation of a quadtree with Game of Life's hashlife algorithm.

Usage

// empty tree with level 2
qt := quadtree.EmptyTree(2)

// quadtrees are immutable, so each change gives you a new quadtree
qt = qt.SetCell(1, 1, 1)

// print tree to console, don't do that for bigger trees
qt.Print()

// calculates next generation
qtNext := qt.NextGen()