³ò
™›\Kc           @   s€  d  Z  d d k Td d k l Z d d k Z d d d d d	 g Z d
 e f d „  ƒ  YZ d f  d „  ƒ  YZ e	 a
 e	 a e	 a d a d a e	 a e	 a d a d e f d „  ƒ  YZ d „  Z d e f d „  ƒ  YZ d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d  „  Z d! „  Z  d" „  Z! d# d$ „ Z" d% „  Z# d& „  Z$ d' „  Z% e	 d( „ Z& d) „  Z' d* „  Z( d+ „  Z) d, „  Z* d- „  Z+ d. „  Z, d/ „  Z- d0 „  Z. d1 „  Z/ d2 „  Z0 d3 „  Z1 d4 „  Z2 xB e3 e ƒ D]4 Z4 e4 i5 d5 ƒ o e i6 e4 i  e7 e4 ƒ _  n qðWd6 „  Z8 d7 „  Z9 d8 „  Z: d9 „  Z; e< d: j o# e: ƒ  e d; ƒ e; ƒ  e0 ƒ  n d S(<   s4  
Turtle graphics is a popular way for introducing programming to
kids. It was part of the original Logo programming language developed
by Wally Feurzeig and Seymour Papert in 1966.

Imagine a robotic turtle starting at (0, 0) in the x-y plane. Give it
the command turtle.forward(15), and it moves (on-screen!) 15 pixels in
the direction it is facing, drawing a line as it moves. Give it the
command turtle.left(25), and it rotates in-place 25 degrees clockwise.

By combining together these and similar commands, intricate shapes and
pictures can easily be drawn.
iÿÿÿÿ(   t   *(   t   sleepNt   fastestt   fastt   normalt   slowt   slowestt   Errorc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR      s   t   RawPenc           B   sF  e  Z d  „  Z d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d	 „  Z
 d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e d „ Z d „  Z d „  Z d „  Z d# d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d „  Z" d  „  Z# g  d! „ Z$ d" „  Z% RS($   c         C   sN   | |  _  g  |  _ d |  _ d |  _ d |  _ d |  _ |  i ƒ  |  i ƒ  d  S(   Ni   i    i
   g        (   t   _canvast   _itemst   _tracingt   _arrowt   _delayt   _anglet   degreest   reset(   t   selft   canvas(    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   __init__   s    						
g     €v@c         C   sC   |  i  o |  i  |  i | |  _  n | |  _ t | d |  _ d S(   s`    Set angle measurement units to degrees.

        Example:
        >>> turtle.degrees()
        g      à?N(   R   t   _fullcirclet   pit
   _invradian(   R   t
   fullcircle(    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR   &   s    
	c         C   s   |  i  d t ƒ d S(   sd    Set the angle measurement units to radians.

        Example:
        >>> turtle.radians()
        g       @N(   R   R   (   R   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   radians3   s    c         C   sç   |  i  } |  i  i ƒ  | i ƒ  } | i ƒ  } | d j o | d } n | d j o | d } n t | ƒ d t | ƒ d f |  _ |  i |  _ d |  _ d |  _ d |  _	 d |  _
 d |  _ g  |  _ |  i ƒ  | i ƒ  i ƒ  d S(	   sD   Clear the screen, re-center the pen, and set variables to
        the default values.

        Example:
        >>> turtle.position()
        [0.0, -22.0]
        >>> turtle.heading()
        100.0
        >>> turtle.reset()
        >>> turtle.position()
        [0.0, 0.0]
        >>> turtle.heading()
        0.0
        i   t   widtht   heightg       @g        t   blacki    N(   R   t   updatet   winfo_widtht   winfo_heightt   floatt   _origint	   _positionR   t   _drawingt   _widtht   _colort   _fillingt   _patht   cleart   _roott   tkraise(   R   R   R   R   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR   ;   s$    	#						
c         C   s^   |  i  d ƒ |  i } |  i } g  |  _ x | D] } | i | ƒ q/ W|  i ƒ  |  i ƒ  d S(   sb    Clear the screen. The turtle does not move.

        Example:
        >>> turtle.clear()
        i    N(   t   fillR   R   t   deletet   _delete_turtlet   _draw_turtle(   R   R   t   itemst   item(    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR)   ]   s    			 
c         C   s/   | |  _  |  i  p |  i ƒ  n |  i ƒ  d S(   sñ    Set tracing on if flag is True, and off if it is False.
        Tracing means line are drawn more slowly, with an
        animation of an arrow along the line.

        Example:
        >>> turtle.tracer(False)   # turns off Tracer
        N(   R   R.   R/   (   R   t   flag(    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   tracerl   s    	
c         C   sc   |  i  \ } } } | | t |  i |  i ƒ } | | t |  i |  i ƒ } |  i | | ƒ d S(   s   Go forward distance steps.

        Example:
        >>> turtle.position()
        [0.0, 0.0]
        >>> turtle.forward(25)
        >>> turtle.position()
        [25.0, 0.0]
        >>> turtle.forward(-75)
        >>> turtle.position()
        [-50.0, 0.0]
        N(   R#   t   cosR   R   t   sint   _goto(   R   t   distancet   x0t   y0t   startt   x1t   y1(    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   forwardy   s    c         C   s   |  i  | ƒ d S(   së    Go backwards distance steps.

        The turtle's heading does not change.

        Example:
        >>> turtle.position()
        [0.0, 0.0]
        >>> turtle.backward(30)
        >>> turtle.position()
        [-30.0, 0.0]
        N(   R=   (   R   R7   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   backward‹   s    c         C   s%   |  i  | |  i |  _  |  i ƒ  d S(   s]   Turn left angle units (units are by default degrees,
        but can be set via the degrees() and radians() functions.)

        When viewed from above, the turning happens in-place around
        its front tip.

        Example:
        >>> turtle.heading()
        22
        >>> turtle.left(45)
        >>> turtle.heading()
        67.0
        N(   R   R   R/   (   R   t   angle(    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   left™   s    c         C   s   |  i  | ƒ d S(   s`   Turn right angle units (units are by default degrees,
        but can be set via the degrees() and radians() functions.)

        When viewed from above, the turning happens in-place around
        its front tip.

        Example:
        >>> turtle.heading()
        22
        >>> turtle.right(45)
        >>> turtle.heading()
        337.0
        N(   R@   (   R   R?   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   rightª   s    c         C   s   d |  _  d S(   s^    Pull the pen up -- no drawing when moving.

        Example:
        >>> turtle.up()
        i    N(   R$   (   R   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   upº   s    c         C   s   d |  _  d S(   s[    Put the pen down -- draw when moving.

        Example:
        >>> turtle.down()
        i   N(   R$   (   R   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   downÂ   s    c         C   s   t  | ƒ |  _ d S(   s\    Set the line to thickness to width.

        Example:
        >>> turtle.width(10)
        N(   R!   R%   (   R   R   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR   Ê   s    c   	      G   sÎ  | p t  d ‚ n t | ƒ d j o· | d } t | ƒ t d ƒ j oc y% |  i i d d d d d | ƒ} Wn& t i j
 o t  d | f ‚ n X|  i | ƒ d Sn y | \ } } } Wqt  d | f ‚ qXn. y | \ } } } Wn t  d	 | f ‚ n Xd | j o
 d j n p t ‚ d | j o
 d j n p t ‚ d | j o
 d j n p t ‚ d
 } d } |  i d t	 | | | ƒ t	 | | | ƒ t	 | | | ƒ f ƒ d S(   sb   Set the pen color.

        Three input formats are allowed:

            color(s)
            s is a Tk specification string, such as "red" or "yellow"

            color((r, g, b))
            *a tuple* of r, g, and b, which represent, an RGB color,
            and each of r, g, and b are in the range [0..1]

            color(r, g, b)
            r, g, and b represent an RGB color, and each of r, g, and b
            are in the range [0..1]

        Example:

        >>> turtle.color('brown')
        >>> tup = (0.2, 0.8, 0.55)
        >>> turtle.color(tup)
        >>> turtle.color(0, .5, 0)
        s   no color argumentsi   i    t    R,   s   bad color string: %rNs   bad color sequence: %rs   bad color arguments: %rg     ào@g      à?s   #%02x%02x%02x(
   R   t   lent   typeR   t   create_linet   Tkintert   TclErrort
   _set_colort   AssertionErrort   int(	   R   t   argst   colort   idt   rt   gt   bt   xt   y(    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRN   Ò   s2    
%%%%c         C   s   | |  _  |  i ƒ  d  S(   N(   R&   R/   (   R   RN   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRJ     s    	c   
   	   C   s    |  i  \ } } | d } |  i i | | d t | ƒ d d d |  i ƒ} |  i i | ƒ | o2 |  i i | ƒ \ } } } }	 |  i | |	 ƒ n |  i	 ƒ  d S(   s   Write text at the current pen position.

        If move is true, the pen is moved to the bottom-right corner
        of the text. By default, move is False.

        Example:
        >>> turtle.write('The race is on!')
        >>> turtle.write('Home = (0, 0)', True)
        i   t   textt   anchort   swR,   N(
   R#   R   t   create_textt   strR&   R   t   appendt   bboxR6   R/   (
   R   RU   t   moveRS   RT   R1   R8   R9   R;   R<   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   write	  s    

c         C   s´   |  i  ov t |  i ƒ } |  i  d j  } t | ƒ d j oA |  i i d | h  |  i d <| d <ƒ } |  i i | ƒ q€ n g  |  _ | |  _  | o |  i i |  i	 ƒ n d S(   s}   Call fill(1) before drawing the shape you
         want to fill, and fill(0) when done.

        Example:
        >>> turtle.fill(1)
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.fill(0)
        i    i   t   polygonR,   t   smoothN(
   R'   t   tupleR(   RE   R   t   _createR&   R   RZ   R#   (   R   R2   t   pathR_   R1   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR,     s    
		c         C   s   |  i  g |  _ d |  _ d S(   sÔ   Called just before drawing a shape to be filled.
            Must eventually be followed by a corresponding end_fill() call.
            Otherwise it will be ignored.

        Example:
        >>> turtle.begin_fill()
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.end_fill()
        i   N(   R#   R(   R'   (   R   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt
   begin_fill:  s    c         C   s   |  i  d ƒ d S(   sX   Called after drawing a shape to be filled.

        Example:
        >>> turtle.begin_fill()
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.end_fill()
        i    N(   R,   (   R   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   end_fillM  s    c   	      C   s  | d	 j o |  i } n t | ƒ |  i } d t t d t | ƒ d d ƒ | ƒ } d | | } d | } d | t | |  i ƒ } | d j  o | | | } } } n |  i | ƒ x. t | ƒ D]  } |  i	 | ƒ |  i | ƒ qÍ W|  i
 | ƒ d	 S(
   sc   Draw a circle with given radius.
        The center is radius units left of the turtle; extent
        determines which part of the circle is drawn. If not given,
        the entire circle is drawn.

        If extent is not a full circle, one endpoint of the arc is the
        current pen position. The arc is drawn in a counter clockwise
        direction if radius is positive, otherwise in a clockwise
        direction. In the process, the direction of the turtle is
        changed by the amount of the extent.

        >>> turtle.circle(50)
        >>> turtle.circle(120, 180)  # half a circle
        i   i   g      @g     €M@g      ð?g      à?g       @i    N(   t   NoneR   t   absRL   t   minR5   R   R@   t   rangeR=   RA   (	   R   t   radiust   extentt   fract   stepst   wt   w2t   lt   i(    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   circle]  s    +
 c         C   s   |  i  S(   sj    Return the turtle's current heading.

        Example:
        >>> turtle.heading()
        67.0
        (   R   (   R   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   heading{  s    c         C   s   | |  _  |  i ƒ  d S(   s`   Set the turtle facing the given angle.

        Here are some common directions in degrees:

           0 - east
          90 - north
         180 - west
         270 - south

        Example:
        >>> turtle.setheading(90)
        >>> turtle.heading()
        90
        >>> turtle.setheading(128)
        >>> turtle.heading()
        128
        N(   R   R/   (   R   R?   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt
   setheading„  s    	c         C   s1   |  i  i ƒ  } | d j o |  i  d } n | S(   sq    Returns the width of the turtle window.

        Example:
        >>> turtle.window_width()
        640
        i   R   (   R   R   (   R   R   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   window_width™  s    c         C   s1   |  i  i ƒ  } | d j o |  i  d } n | S(   sr    Return the height of the turtle window.

        Example:
        >>> turtle.window_height()
        768
        i   R   (   R   R    (   R   R   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   window_height¥  s    c         C   s1   |  i  \ } } |  i \ } } | | | | g S(   s€    Return the current (x, y) location of the turtle.

        Example:
        >>> turtle.position()
        [0.0, 240.0]
        (   R"   R#   (   R   R8   R9   R;   R<   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   position±  s    c         C   s6   |  i  \ } } |  i \ } } |  i | | | ƒ d S(   sÉ    Set the turtle's x coordinate to be xpos.

        Example:
        >>> turtle.position()
        [10.0, 240.0]
        >>> turtle.setx(10)
        >>> turtle.position()
        [10.0, 240.0]
        N(   R"   R#   R6   (   R   t   xposR8   R9   R;   R<   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   setx¼  s    
c         C   s6   |  i  \ } } |  i \ } } |  i | | | ƒ d S(   sÆ    Set the turtle's y coordinate to be ypos.

        Example:
        >>> turtle.position()
        [0.0, 0.0]
        >>> turtle.sety(-22)
        >>> turtle.position()
        [0.0, -22.0]
        N(   R"   R#   R6   (   R   t   yposR8   R9   R;   R<   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   setyÊ  s    
c   	      G   s    t  | ƒ d j o | \ } } n= | d } t | t ƒ o | i ƒ  \ } } n | \ } } |  i ƒ  \ } } | | } | | } t | | ƒ |  i |  i S(   s>  Returs the angle, which corresponds to the line
        from turtle-position to point (x,y).

        Argument can be two coordinates or one pair of coordinates
        or a RawPen/Pen instance.

        Example:
        >>> turtle.position()
        [10.0, 10.0]
        >>> turtle.towards(0,0)
        225.0
        i   i    (   RE   t
   isinstanceR
   Rv   t   atan2R   R   (	   R   RM   RS   RT   t   argR8   R9   t   dxt   dy(    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   towardsØ  s    


c         G   s¢   t  | ƒ d j o6 y | d \ } } Wqw t d | d f ‚ qw Xn/ y | \ } } Wn t d | d f ‚ n X|  i \ } } |  i | | | | ƒ d S(   s·   Go to the given point.

        If the pen is down, then a line will be drawn. The turtle's
        orientation does not change.

        Two input formats are accepted:

           goto(x, y)
           go to point (x, y)

           goto((x, y))
           go to point (x, y)

        Example:
        >>> turtle.position()
        [0.0, 0.0]
        >>> turtle.goto(50, -45)
        >>> turtle.position()
        [50.0, -45.0]
        i   i    s   bad point argument: %rs   bad coordinates: %rN(   RE   R   R"   R6   (   R   RM   RS   RT   R8   R9   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   gotoò  s    c         C   s  |  i  \ } } t t | | f ƒ |  _  |  i o |  i i |  i  ƒ n |  i o¨|  i oWt | | ƒ } t | | ƒ } t | | ƒ } t	 | ƒ } |  i
 i | | | | d |  i d d d |  i ƒ}	 yÈ x t d d | ƒ D]z }
 | | |
 | | | |
 | } } |  i
 i |	 | | | | ƒ |  i | | f ƒ |  i
 i ƒ  |  i
 i |  i ƒ qá W|  i
 i |	 | | | | ƒ |  i
 i |	 d d ƒWqæt i j
 o d  SqæXn4 |  i
 i | | | | d |  i d d d |  i ƒ}	 |  i i |	 ƒ n |  i ƒ  d  S(   NR   t   capstylet   roundR,   i   t   arrowt   none(   R#   t   mapR!   R'   R(   RZ   R$   R   t   hypotRL   R   RG   R%   R&   Rh   t   coordsR/   R   t   afterR   t   itemconfigureRH   RI   R   (   R   R;   R<   R8   R9   R~   R   R7   t   nhopsR1   Rp   RS   RT   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR6     s@    


	 %	c         C   sP   y, | i  ƒ  i ƒ  } t i | ƒ d |  _ Wn t d | t f ƒ ‚ n Xd S(   s@   Set the turtle's speed.

        speed must one of these five strings:

            'fastest' is a 0 ms delay
            'fast' is a 5 ms delay
            'normal' is a 10 ms delay
            'slow' is a 15 ms delay
            'slowest' is a 20 ms delay

         Example:
         >>> turtle.speed('slow')
        i   s0   %r is not a valid speed. speed must be one of %sN(   t   stript   lowert   speedst   indexR   t
   ValueError(   R   t   speed(    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR‘   8  s    c         C   s6   t  | ƒ d j  o t d ƒ ‚ n t  | ƒ |  _ d S(   sÅ    Set the drawing delay in milliseconds.

        This is intended to allow finer control of the drawing speed
        than the speed() method

        Example:
        >>> turtle.delay(15)
        i    s(   delay must be greater than or equal to 0N(   RL   R   R   (   R   t   delay(    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR’   N  s    	c         C   sÞ   |  i  p |  i i ƒ  d  Sn | g  j o |  i } n | \ } } d } | t |  i |  i ƒ } | t |  i |  i ƒ } |  i ƒ  |  i i	 | | | | | | d |  i
 d d d d d |  i ƒ|  _ |  i i ƒ  d  S(   Ni   R   R„   t   lastR‚   Rƒ   R,   (   R   R   R   R#   R4   R   R   R5   R.   RG   R%   R&   R   (   R   Rv   RS   RT   R7   R~   R   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR/   [  s     

 	c         C   s4   |  i  d j o  |  i i |  i  ƒ d |  _  n d  S(   Ni    (   R   R   R-   (   R   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR.   m  s    N(&   R   R	   R   R   R   R   R)   R3   R=   R>   R@   RA   RB   RC   R   RN   RJ   t   FalseR]   R,   Rc   Rd   Re   Rq   Rr   Rs   Rt   Ru   Rv   Rx   Rz   R€   R   R6   R‘   R’   R/   R.   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR
      sD   	
		"										3														"	$		g      à?g      è?s   Turtle Graphicst   Penc           B   s   e  Z d  „  Z d „  Z RS(   c      	   C   s¬   t  d  j o0 t i ƒ  a  t  i d |  i ƒ t  i t ƒ n t d  j oN t i	 t  d d ƒa t i
 d d d d ƒ t d t d	 t d
 t d t ƒ n t i |  t ƒ d  S(   Nt   WM_DELETE_WINDOWt
   backgroundt   whitet   expandi   R,   t   bothR   R   t   startxt   starty(   R*   Re   RH   t   Tkt   wm_protocolt   _destroyt   titlet   _titleR   t   Canvast   packt   setupR%   t   _heightt   _startxt   _startyR
   R   (   R   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR   ~  s    #c         C   s@   |  i  i ƒ  } | t j o d  a d  a d  a  n | i ƒ  d  S(   N(   R   R*   Re   t   _pent   destroy(   R   t   root(    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRŸ   Ž  s    
(   R   R	   R   RŸ   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR•   |  s   	c           C   s   t  p t ƒ  a  n t  S(   N(   R¨   R•   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   _getpen—  s    t   Turtlec           B   s   e  Z RS(    (   R   R	   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR¬     s   c           C   s   t  ƒ  i ƒ  d  S(   N(   R«   R   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR   ¤  s    c           C   s   t  ƒ  i ƒ  d  S(   N(   R«   R   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR   ¥  s    c           C   s   t  ƒ  i ƒ  d  S(   N(   R«   R   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR   ¦  s    c           C   s   t  ƒ  i ƒ  d  S(   N(   R«   R)   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR)   §  s    c         C   s   t  ƒ  i |  ƒ d  S(   N(   R«   R3   (   R2   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR3   ¨  s    c         C   s   t  ƒ  i |  ƒ d  S(   N(   R«   R=   (   R7   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR=   ©  s    c         C   s   t  ƒ  i |  ƒ d  S(   N(   R«   R>   (   R7   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR>   ª  s    c         C   s   t  ƒ  i |  ƒ d  S(   N(   R«   R@   (   R?   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR@   «  s    c         C   s   t  ƒ  i |  ƒ d  S(   N(   R«   RA   (   R?   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRA   ¬  s    c           C   s   t  ƒ  i ƒ  d  S(   N(   R«   RB   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRB   ­  s    c           C   s   t  ƒ  i ƒ  d  S(   N(   R«   RC   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRC   ®  s    c         C   s   t  ƒ  i |  ƒ d  S(   N(   R«   R   (   R   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR   ¯  s    c          G   s   t  ƒ  i |  Œ  d  S(   N(   R«   RN   (   RM   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRN   °  s    i    c         C   s   t  ƒ  i |  | ƒ d  S(   N(   R«   R]   (   R}   R\   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR]   ±  s    c         C   s   t  ƒ  i |  ƒ d  S(   N(   R«   R,   (   R2   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR,   ²  s    c           C   s   t  ƒ  i ƒ  d  S(   N(   R«   Rc   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRc   ³  s    c           C   s   t  ƒ  i ƒ  d  S(   N(   R«   Rd   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRd   ´  s    c         C   s   t  ƒ  i |  | ƒ d  S(   N(   R«   Rq   (   Ri   Rj   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRq   µ  s    c          G   s   t  ƒ  i |  Œ  d  S(   N(   R«   R   (   RM   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR   ¶  s    c           C   s   t  ƒ  i ƒ  S(   N(   R«   Rr   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRr   ·  s    c         C   s   t  ƒ  i |  ƒ d  S(   N(   R«   Rs   (   R?   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRs   ¸  s    c           C   s   t  ƒ  i ƒ  S(   N(   R«   Rv   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRv   ¹  s    c           C   s   t  ƒ  i ƒ  S(   N(   R«   Rt   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRt   º  s    c           C   s   t  ƒ  i ƒ  S(   N(   R«   Ru   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRu   »  s    c         C   s   t  ƒ  i |  ƒ d  S(   N(   R«   Rx   (   Rw   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRx   ¼  s    c         C   s   t  ƒ  i |  ƒ d  S(   N(   R«   Rz   (   Ry   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyRz   ½  s    c          G   s   t  ƒ  i |  Œ  S(   N(   R«   R€   (   RM   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR€   ¾  s    c           C   s   t  i ƒ  d  S(   N(   R*   t   mainloop(    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   doneÀ  s    c         C   s   t  ƒ  i |  ƒ S(   N(   R«   R’   (   R’   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR’   Á  s    c         C   s   t  ƒ  i |  ƒ S(   N(   R«   R‘   (   R‘   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR‘   Â  s    t   _c          K   så  |  i  d t ƒ } | d j p | d j o
 | a n
 t d ‚ |  i  d t ƒ } | d j p | d j o
 | a n
 t d ‚ |  i  d t ƒ } | d j p | d j o
 t a n
 t d ‚ |  i  d t ƒ } | d j p | d j o
 | a n
 t d ‚ t oÞ t o× t oÐ d t j  o
 d	 j n o t i ƒ  | 
a n d t j  o
 d	 j n o t i	 ƒ  t a n t d j o t i ƒ  t d
 a n t d j o t i	 ƒ  t d
 a n t i
 d t t t t f ƒ n d S(   s    Sets the size and position of the main window.

    Keywords are width, height, startx and starty:

    width: either a size in pixels or a fraction of the screen.
      Default is 50% of screen.
    height: either the height in pixels or a fraction of the screen.
      Default is 75% of screen.

    Setting either width or height to None before drawing will force
      use of default geometry as in older versions of turtle.py

    startx: starting position in pixels from the left edge of the screen.
      Default is to center window. Setting startx to None is the default
      and centers window horizontally on screen.

    starty: starting position in pixels from the top edge of the screen.
      Default is to center window. Setting starty to None is the default
      and centers window vertically on screen.

    Examples:
    >>> setup (width=200, height=200, startx=0, starty=0)

    sets window to 200x200 pixels, in upper left of screen

    >>> setup(width=.75, height=0.5, startx=None, starty=None)

    sets window to 75% of screen by 50% of screen and centers

    >>> setup(width=None)

    forces use of default geometry as in older versions of turtle.py
    R   i    s   width can not be less than 0R   s   height can not be less than 0R›   s   startx can not be less than 0Rœ   i   i   s   %dx%d+%d+%dN(   t   getR%   Re   R   R¥   R¦   R§   R*   t   winfo_screenwidtht   winfo_screenheightt   geometry(   R³   R   R   R›   Rœ   (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR¤   Ê  s4    %
	
	
	
	c         C   s
   |  a  d S(   st   Set the window title.

    By default this is set to 'Turtle Graphics'

    Example:
    >>> title("My Window")
    N(   R¡   (   R    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyR      s    
c          C   sù  t  ƒ  t d ƒ t ƒ  t d ƒ t ƒ  t d ƒ x— t d ƒ D]‰ }  |  d j o t d ƒ n x( t d ƒ D] } t d ƒ t	 d ƒ qn W|  d j o t
 d ƒ t d	 ƒ n t ƒ  t d
 ƒ t ƒ  q@ Wt d ƒ t
 d ƒ t d	 ƒ t ƒ  t d ƒ t d ƒ t d ƒ t d ƒ t d ƒ t ƒ  t d d ƒ t d d ƒ t
 d ƒ x< t d ƒ D]. }  t d ƒ t	 d ƒ t d ƒ t d ƒ q\Wt d ƒ x< t d ƒ D]. }  t d ƒ t	 d ƒ t d ƒ t d ƒ q¥Wt d	 ƒ t d ƒ t d ƒ d  S(   Ni   id   i   i   i   i   iZ   t   marooni    i   R   i´   t
   startstartR:   t   redi   t   end(   R   R3   RB   R>   RC   R   Rh   R,   R=   R@   RN   RA   R]   (   Rp   t   j(    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   demo#  sb    


  











 



 




c    	   
   C   sÖ  t  d ƒ t d ƒ t t d d ƒ ƒ t ƒ  \ }  } |  d | d d d } t d ƒ t } xF t d ƒ D]8 } | o t ƒ  t	 } n t
 ƒ  t } t | d	 ƒ qm Wt d ƒ t ƒ  t d ƒ d	 } t d
 ƒ t d ƒ t d ƒ d } xÀ t d d ƒ D]¯ } | d j o4 t d d | d d | ƒ t d ƒ t d
 ƒ n x( t d ƒ D] } t | ƒ t d ƒ qRW| d	 7} t d ƒ | d j o | d } t  t | ƒ qþ qþ Wt d d d ƒ t d ƒ t d ƒ t ƒ  t d ƒ t d ƒ t
 ƒ  t d ƒ t  d ƒ t d ƒ x? t d ƒ D]1 } t d d ƒ t d ƒ t d ƒ t d ƒ q"Wt d ƒ t d ƒ t d ƒ t ƒ  t d ƒ t
 ƒ  t d ƒ t ƒ  } | i ƒ  | i d ƒ | i  d ƒ | i ƒ  | i d d ƒ | i d  ƒ | i
 ƒ  | i  d ƒ | i d! ƒ | i d ƒ t  d ƒ t t | ƒ ƒ x‰ t t ƒ  d | i ƒ  d ƒ d j p( t t ƒ  d | i ƒ  d ƒ d j o8 | i d" ƒ | i d# ƒ t t | ƒ ƒ t d ƒ q9Wt d$ d% t ƒd  S(&   NR   i   i    i   g      à?g       @iZ   i   i
   t   greeni´   i   iþÿÿÿi   g      ð?gš™™™™™©?i   ix   i   g      Ð?g      è?iF   i   R¶   R   i   i2   t   yellowR   i  i(   i   t   blueg      @g333333ã?s   CAUGHT! R\   (   R‘   R   Rs   R€   Rv   RA   t   TrueRh   RB   R”   RC   Rq   R   R   R@   RN   R,   R=   RŽ   R¬   R   Rf   R]   (	   RS   RT   RP   t   pendownRp   Ro   t   spR¸   t   turtle(    (    s#   /usr/lib/python2.5/lib-tk/turtle.pyt   demo2X  s¤    


 





 
 










 






	



 ((t   __main__i   (=   t   __doc__t   matht   timeR   RH   RŽ   t	   ExceptionR   R
   Re   R*   R   R¨   R%   R¥   R¦   R§   R¡   R•   R«   R¬   R   R   R   R)   R3   R=   R>   R@   RA   RB   RC   R   RN   R]   R,   Rc   Rd   Rq   R   Rr   Rs   Rv   Rt   Ru   Rx   Rz   R€   R®   R’   R‘   t   dirt
   methodnamet
   startswitht   __dict__t   evalR¤   R    R¹   RÁ   R   (    (    (    s#   /usr/lib/python2.5/lib-tk/turtle.pys   <module>   s|   
ÿ ÿ [																													 !	M		5	`
