/rewrite

L-system implemented in Go with Ebitengine

Primary LanguageGoApache License 2.0Apache-2.0

Rewrite

L-system implemented in Go with Ebitengine.

Demo

Fractal Plant / Barnsley Fern

BarnsleyFern.mov

Fractal / Binary Tree

BinaryTree.mov

Dragon Curve

DragonCurve.mov

Koch Curve

KochCurve.mov

Sierpinski Triangle

SierpinskiTriangle.mov

Code

  • system/ L-system interface and rewriting logic (see below), and a few examples.
  • render/ Renderer inferface with turtle graphics.
  • game/ Game engine logic.
  • main.go Entry point. Select examples here.
type System interface {
	Axioms() []rune
	Rule(r rune) []rune
}

type PathRenderer interface {
	Render(runes []rune) vector.Path
	AsyncRender(runes []rune, cancel <-chan struct{}) <-chan vector.Path
}