Closed HowcanoeWang closed 2 years ago
Looks like it was a mistake in the readme file and get(i) return instance not iteration. Added new property iter to get iteration. Now
import lsystem.exec
import math
exec = lsystem.exec.Exec()
exec.set_axiom("X")
exec.add_rule("X", "AX")
exec.add_rule("A", "F[-(get(iter))F]")
exec.exec(min_iterations=4, angle=25)
Should result in
F[-(1)F]F[-(2)F]F[-(3)F]AX
(because I start from 0 and not 1)
the outputs:
Expected:
F[-(2)F]F[-(3)F]F[-(4)F]AX
I check the source code in
lsystem.py
, It seems theself.constant
value never updated by iteration and keeps 0 as is initialized