The turtle-dragon Python API
Common definitions
turtle_dragon.defs
Common definitions for the turtle-dragon library.
FEATURES = {'turtle-dragon': VERSION}
module-attribute
The list of features supported by the turtle-dragon library.
VERSION = '0.1.0'
module-attribute
The turtle-dragon library version, semver-like.
Config
dataclass
Runtime configuration for the turtle-dragon library.
Source code in src/turtle_dragon/defs.py
cache
instance-attribute
The cached turns for relatively small values of the generation.
log
instance-attribute
The logger to send diagnostic, informational, and error messages to.
Turn
Bases: StrEnum
The direction of the turn that we must make now.
Source code in src/turtle_dragon/defs.py
LEFT = 'left'
class-attribute
instance-attribute
Turn left.
RIGHT = 'right'
class-attribute
instance-attribute
Turn right.
Calculate the turns of the dragon curve
turtle_dragon.calc
Calculate the turns of a dragon curve.
CACHE_MAX = 131071
module-attribute
The largest generation value that we are willing to cache.
turn(cfg, generation)
Calculate successive turns.