Created
January 10, 2020 05:41
-
-
Save dnanto/6b82b309d15d1390a8d0dd205c323d83 to your computer and use it in GitHub Desktop.
L-system string generator in python...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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