B  O#6($ÊÜã@sDdZddlTdd„Zdd„Zdd„Zed kr@eƒZeeƒeƒd S) aë turtle-example-suite: xtx_lindenmayer_indian.py Each morning women in Tamil Nadu, in southern India, place designs, created by using rice flour and known as kolam on the thresholds of their homes. These can be described by Lindenmayer systems, which can easily be implemented with turtle graphics and Python. Two examples are shown here: (1) the snake kolam (2) anklets of Krishna Taken from Marcia Ascher: Mathematics Elsewhere, An Exploration of Ideas Across Cultures é)Ú*cCs<x6t|ƒD]*}d}x|D]}|| ||¡}qW|}q W|S)NÚ)ÚrangeÚget)ÚseqZreplacementRulesÚnÚiZnewseqZelement©r ú;/opt/alt/python37/lib64/python3.7/turtledemo/lindenmayer.pyÚreplaces  r c CsVxP|D]H}y||ƒWqtk rLyt|||ƒWn YnXYqXqWdS)N)Ú TypeErrorÚdraw)ZcommandsZrulesÚbr r r r &s r cCsdd„}dd„}dd„}|||ddœ}d d i}d }t||d ƒ}tƒtd ƒtd dƒtƒtƒtdƒtƒt||ƒddl m }|d ƒdd„}dd„} dd„} || | dœ} dddœ} d} tƒtdƒtd dƒtƒt dƒt| | d ƒ}t|| ƒtd ƒdS)NcSs tdƒdS)Né-)Úrightr r r r Úr7szmain..rcSs tdƒdS)Nr)Úleftr r r r Úl:szmain..lcSs tdƒdS)Ng@)Úforwardr r r r Úf=szmain..fzf+f+f--f--f+f+f)ú-ú+rrrzb+f+b--f--b+f+bz b--f--b--fééréÃ)ÚsleepcSstdƒtddƒdS)NZredé éZ)ÚcolorÚcircler r r r ÚAVszmain..AcSs>ddlm}tdƒd|dƒ}t|ƒt|dƒt|ƒdS)Nr)ÚsqrtZblackééi)Zmathr!rrr)r!rr r r ÚBZs    zmain..BcSstdƒtdƒdS)NZgreenr)rrr r r r ÚFbszmain..F)ÚarrZafbfaZ afbfbfbfa)r&rZfbfbfbfbrzDone!) r ÚresetZspeedZtracerZhtZupZbackwardZdownr Ztimerr)rrrZ snake_rulesZsnake_replacementRulesZ snake_startZdrawingrr r$r%Z krishna_rulesZkrishna_replacementRulesZ krishna_startr r r Úmain1s@         r(Ú__main__N) Ú__doc__Zturtler r r(Ú__name__ÚmsgÚprintZmainloopr r r r Ús C