B
    v9a‚	  ã               @   s@   d dl T dd„ Zdd„ Zdd„ Zedkr<eƒ Zeeƒ eƒ  d	S )
é    )Ú*c             C   s<   x6t |ƒD ]*}d}x| D ]}|| ||¡ }qW |} q
W | S )NÚ )ÚrangeÚget)ÚseqZreplacementRulesÚnÚiZnewseqZelement© r	   ú!/usr/lib/python3.7/lindenmayer.pyÚreplace   s    
r   c          
   C   sV   xP| D ]H}y|| ƒ  W q t k
rL   yt|| |ƒ W n   Y nX Y qX qW d S )N)Ú	TypeErrorÚdraw)ZcommandsZrulesÚbr	   r	   r
   r   &   s    
r   c              C   s  dd„ } dd„ }dd„ }| ||ddœ}d	d
i}d}t ||dƒ}tƒ  tdƒ tddƒ tƒ  tƒ  tdƒ tƒ  t||ƒ ddl	m
} |dƒ dd„ }dd„ }	dd„ }
||	|
dœ}dddœ}d}tƒ  tdƒ tddƒ tƒ  tdƒ t ||dƒ}t||ƒ tdƒ dS )Nc               S   s   t dƒ d S )Né-   )Úrightr	   r	   r	   r
   Úr7   s    zmain.<locals>.rc               S   s   t dƒ d S )Nr   )Úleftr	   r	   r	   r
   Úl:   s    zmain.<locals>.lc               S   s   t dƒ d S )Ng      @)Úforwardr	   r	   r	   r
   Úf=   s    zmain.<locals>.fzf+f+f--f--f+f+f)ú-ú+r   r   r   zb+f+b--f--b+f+bz
b--f--b--fé   é   r   éÃ   )Úsleepc               S   s   t dƒ tddƒ d S )NZredé
   éZ   )ÚcolorÚcircler	   r	   r	   r
   ÚAV   s    zmain.<locals>.Ac              S   s>   ddl m}  tdƒ d| dƒ }t|ƒ t|dƒ t|ƒ d S )Nr   )ÚsqrtZblacké   é   i  )Zmathr!   r   r   r   )r!   r   r	   r	   r
   ÚBZ   s    
zmain.<locals>.Bc               S   s   t dƒ tdƒ d S )NZgreenr   )r   r   r	   r	   r	   r
   ÚFb   s    zmain.<locals>.F)Úar   r   ZafbfaZ	afbfbfbfa)r&   r   Zfbfbfbfbr   zDone!)r   ÚresetZspeedZtracerZhtZupZbackwardZdownr   Ztimer   r   )r   r   r   Zsnake_rulesZsnake_replacementRulesZsnake_startZdrawingr   r    r$   r%   Zkrishna_rulesZkrishna_replacementRulesZkrishna_startr	   r	   r
   Úmain1   s@    




r(   Ú__main__N)Zturtler   r   r(   Ú__name__ÚmsgÚprintZmainloopr	   r	   r	   r
   Ú<module>   s   C