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

Method loop

generative/lsystem/grammar.py:179–183  ·  view source on GitHub ↗

Apply the productions rules n times to the given axiom, and return the result.

(self, axiom: Iterable[Token], n: int = 1)

Source from the content-addressed store, hash-verified

177 left = token
178
179 def loop(self, axiom: Iterable[Token], n: int = 1) -> Iterable[Token]:
180 """Apply the productions rules n times to the given axiom, and return the result."""
181 for _ in range(n):
182 axiom = self.rewrite(axiom)
183 return axiom

Callers 2

mainFunction · 0.95
test_loopMethod · 0.80

Calls 1

rewriteMethod · 0.95

Tested by 1

test_loopMethod · 0.64