
    ;e	                     p    	 d dl T d Zd Zd Zedk    r! e            Z ee            e             dS dS )    )*c                 n    t          |          D ]$}d}| D ]}||                    ||          z   }|} %| S )N )rangeget)seqreplacementRulesninewseqelements         -/usr/lib/python3.11/turtledemo/lindenmayer.pyreplacer      sV    1XX   	D 	DG.2277CCCFFJ    c                     | D ]B}	  ||                      # t           $ r" 	 t          ||         |           n#  Y nxY wY ?w xY wd S )N)	TypeErrordraw)commandsrulesbs      r   r   r   &   sx      	E!HJJJJ 	 	 	U1Xu%%%%		 s!   
A9A=AAc                     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}t                       t          d           t          d	d           t	                       t          d           t          ||d	          }t          ||           t          d
           dS )Nc                  $    t          d           d S N-   )right r   r   rzmain.<locals>.r7   s    b					r   c                  $    t          d           d S r   )leftr   r   r   lzmain.<locals>.l:   s    Rr   c                  $    t          d           d S )Ng      @)forwardr   r   r   fzmain.<locals>.f=   s    r   zf+f+f--f--f+f+f)-+r#   r   r   zb+f+b--f--b+f+bz
b--f--b--f      r      )sleepc                  D    t          d           t          dd           d S )Nred
   Z   )colorcircler   r   r   Azmain.<locals>.AV   s    er"r   c                      ddl m}  t          d           d | d          z  }t          |           t	          |d           t          |           d S )Nr   )sqrtblack      i  )mathr2   r.   r"   r/   )r2   r    s     r   Bzmain.<locals>.BZ   sW    gdd1ggI


q#




r   c                  B    t          d           t          d           d S )Ngreenr,   )r.   r"   r   r   r   Fzmain.<locals>.Fb   s    gr   )ar   r#   afbfa	afbfbfbfa)r;   r   fbfbfbfbr   zDone!)r   resetspeedtracerhtupbackwarddownr   timer)   r   )r   r    r#   snake_rulessnake_replacementRulessnake_startdrawingr)   r0   r7   r:   krishna_ruleskrishna_replacementRuleskrishna_starts                 r   mainrN   1   s          aQ,=>>K!#45Kk#91==G	GGG	!HHH
1QKKKDDDDDDSMMMFFF+	E!HHH       q))M&-[BBM	GGG	!HHH
1QKKKDDDHHHm%=qAAG-   
1III7r   __main__N)turtler   r   rN   __name__msgprintmainloopr   r   r   <module>rU      s   4        A A AF Z
$&&C	E#JJJHJJJJJ r   