MCPcopy Create free account
hub / github.com/Notgnoshi/generative / __init__

Method __init__

generative/lsystem/interpreter.py:34–45  ·  view source on GitHub ↗

Initialize an L-System interpreter with the given commandset and turtle config.

(self, commandset, stepsize, angle)

Source from the content-addressed store, hash-verified

32 commandsets = frozenset(["default"])
33
34 def __init__(self, commandset, stepsize, angle):
35 """Initialize an L-System interpreter with the given commandset and turtle config."""
36 if commandset not in self.commandsets:
37 raise ValueError(f"{commandset=} not in {self.commandsets}.")
38 self.commandset = commandset
39 self.turtle = Turtle()
40 self.stepsize = stepsize
41 self.angle = angle
42 self.drawing = True
43 self.orientation_changed = False
44 self.active_line = []
45 self.stack = []
46
47 def tokenize(self, commands: io.TextIOWrapper) -> Tokens:
48 """Tokenize the given input using the configured commandset."""

Callers

nothing calls this directly

Calls 1

TurtleClass · 0.85

Tested by

no test coverage detected