Skip to content

Instantly share code, notes, and snippets.

@dnanto
Created January 10, 2020 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnanto/6b82b309d15d1390a8d0dd205c323d83 to your computer and use it in GitHub Desktop.
Save dnanto/6b82b309d15d1390a8d0dd205c323d83 to your computer and use it in GitHub Desktop.
L-system string generator in python...
#!/usr/bin/env python3
import sys
axiom = "0"
rules = { "0": "1[0]0", "1": "11" }
for i in range(int(sys.argv[1])):
axiom = "".join(rules.get(e, e) for e in axiom)
print(axiom)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment