Skip to content

A small library for creating persistent L-systems in the Go programming language

Notifications You must be signed in to change notification settings

calebwin/go-fern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

What it is

A tiny library for creating Lindenmayer systems. Currently supports stochastic grammars, context-sensitive grammars.

How to use it

import "github.com/calebwin/fern"

var myL = fern.generate("ABC") // create new L-System with an axiom of "ABC"

myRules := map[string][]fern.Successor {
  "A" : []fern.Successor{
    fern.Successor {
      "AB",
      1.0,
      "",
      "",
    },
  },
  "B" : []fern.Successor{
    fern.Successor {
      "BA",
      1.0,
      "C",
      "A",
    },
  },
}
myL = fern.setRules(myL, myRules) // set rules for the L-System

fern.iterate(myL, 3) // "ABBBBC" after 3 iterations of the L-System

About

A small library for creating persistent L-systems in the Go programming language

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages