Current File : /home/mmdealscpanel/yummmdeals.com/turtle.zip
PK�%�Z�v�	11tdemo_I_dontlike_tiltdemo.pynuȯ��#! /usr/bin/python2.7
"""       turtle-example-suite:

     tdemo-I_dont_like_tiltdemo.py

Demonstrates
  (a) use of a tilted ellipse as
      turtle shape
  (b) stamping that shape

We can remove it, if you don't like it.
      Without using reset() ;-)
 ---------------------------------------
"""
from turtle import *
import time

def main():
    reset()
    shape("circle")
    resizemode("user")

    pu(); bk(24*18/6.283); rt(90); pd()
    tilt(45)

    pu()

    turtlesize(16,10,5)
    color("red", "violet")
    for i in range(18):
        fd(24)
        lt(20)
        stamp()
    color("red", "")
    for i in range(18):
        fd(24)
        lt(20)
        stamp()

    tilt(-15)
    turtlesize(3, 1, 4)
    color("blue", "yellow")
    for i in range(17):
        fd(24)
        lt(20)
        if i%2 == 0:
            stamp()
    time.sleep(1)
    while undobufferentries():
        undo()
    ht()
    write("OK, OVER!", align="center", font=("Courier", 18, "bold"))
    return "Done!"

if __name__=="__main__":
    msg = main()
    print msg
    mainloop()
PK�%�Zp��zztdemo_bytedesign.pynuȯ��#! /usr/bin/python2.7
"""      turtle-example-suite:

        tdemo_bytedesign.py

An example adapted from the example-suite
of PythonCard's turtle graphcis.

It's based on an article in BYTE magazine
Problem Solving with Logo: Using Turtle
Graphics to Redraw a Design
November 1982, p. 118 - 134

-------------------------------------------

Due to the statement

t.delay(0)

in line 152, which sets the animation delay
to 0, this animation runs in "line per line"
mode as fast as possible.
"""

import math
from turtle import Turtle, mainloop
from time import clock

# wrapper for any additional drawing routines
# that need to know about each other
class Designer(Turtle):

    def design(self, homePos, scale):
        self.up()
        for i in range(5):
            self.forward(64.65 * scale)
            self.down()
            self.wheel(self.position(), scale)
            self.up()
            self.backward(64.65 * scale)
            self.right(72)
        self.up()
        self.goto(homePos)
        self.right(36)
        self.forward(24.5 * scale)
        self.right(198)
        self.down()
        self.centerpiece(46 * scale, 143.4, scale)
        self.tracer(True)

    def wheel(self, initpos, scale):
        self.right(54)
        for i in range(4):
            self.pentpiece(initpos, scale)
        self.down()
        self.left(36)
        for i in range(5):
            self.tripiece(initpos, scale)
        self.left(36)
        for i in range(5):
            self.down()
            self.right(72)
            self.forward(28 * scale)
            self.up()
            self.backward(28 * scale)
        self.left(54)
        self.getscreen().update()

    def tripiece(self, initpos, scale):
        oldh = self.heading()
        self.down()
        self.backward(2.5 * scale)
        self.tripolyr(31.5 * scale, scale)
        self.up()
        self.goto(initpos)
        self.setheading(oldh)
        self.down()
        self.backward(2.5 * scale)
        self.tripolyl(31.5 * scale, scale)
        self.up()
        self.goto(initpos)
        self.setheading(oldh)
        self.left(72)
        self.getscreen().update()

    def pentpiece(self, initpos, scale):
        oldh = self.heading()
        self.up()
        self.forward(29 * scale)
        self.down()
        for i in range(5):
            self.forward(18 * scale)
            self.right(72)
        self.pentr(18 * scale, 75, scale)
        self.up()
        self.goto(initpos)
        self.setheading(oldh)
        self.forward(29 * scale)
        self.down()
        for i in range(5):
            self.forward(18 * scale)
            self.right(72)
        self.pentl(18 * scale, 75, scale)
        self.up()
        self.goto(initpos)
        self.setheading(oldh)
        self.left(72)
        self.getscreen().update()

    def pentl(self, side, ang, scale):
        if side < (2 * scale): return
        self.forward(side)
        self.left(ang)
        self.pentl(side - (.38 * scale), ang, scale)

    def pentr(self, side, ang, scale):
        if side < (2 * scale): return
        self.forward(side)
        self.right(ang)
        self.pentr(side - (.38 * scale), ang, scale)

    def tripolyr(self, side, scale):
        if side < (4 * scale): return
        self.forward(side)
        self.right(111)
        self.forward(side / 1.78)
        self.right(111)
        self.forward(side / 1.3)
        self.right(146)
        self.tripolyr(side * .75, scale)

    def tripolyl(self, side, scale):
        if side < (4 * scale): return
        self.forward(side)
        self.left(111)
        self.forward(side / 1.78)
        self.left(111)
        self.forward(side / 1.3)
        self.left(146)
        self.tripolyl(side * .75, scale)

    def centerpiece(self, s, a, scale):
        self.forward(s); self.left(a)
        if s < (7.5 * scale):
            return
        self.centerpiece(s - (1.2 * scale), a, scale)

def main():
    t = Designer()
    t.speed(0)
    t.hideturtle()
    t.getscreen().delay(0)
    t.tracer(0)
    at = clock()
    t.design(t.position(), 2)
    et = clock()
    return "runtime: %.2f sec." % (et-at)

if __name__ == '__main__':
    msg = main()
    print msg
    mainloop()
PK�%�Zp��xtdemo_planet_and_moon.pynuȯ��#! /usr/bin/python2.7
"""       turtle-example-suite:

        tdemo_planets_and_moon.py

Gravitational system simulation using the
approximation method from Feynman-lectures,
p.9-8, using turtlegraphics.

Example: heavy central body, light planet,
very light moon!
Planet has a circular orbit, moon a stable
orbit around the planet.

You can hold the movement temporarily by
pressing the left mouse button with the
mouse over the scrollbar of the canvas.

"""
from turtle import Shape, Turtle, mainloop, Vec2D as Vec
from time import sleep

G = 8

class GravSys(object):
    def __init__(self):
        self.planets = []
        self.t = 0
        self.dt = 0.01
    def init(self):
        for p in self.planets:
            p.init()
    def start(self):
        for i in range(10000):
            self.t += self.dt
            for p in self.planets:
                p.step()

class Star(Turtle):
    def __init__(self, m, x, v, gravSys, shape):
        Turtle.__init__(self, shape=shape)
        self.penup()
        self.m = m
        self.setpos(x)
        self.v = v
        gravSys.planets.append(self)
        self.gravSys = gravSys
        self.resizemode("user")
        self.pendown()
    def init(self):
        dt = self.gravSys.dt
        self.a = self.acc()
        self.v = self.v + 0.5*dt*self.a
    def acc(self):
        a = Vec(0,0)
        for planet in self.gravSys.planets:
            if planet != self:
                v = planet.pos()-self.pos()
                a += (G*planet.m/abs(v)**3)*v
        return a
    def step(self):
        dt = self.gravSys.dt
        self.setpos(self.pos() + dt*self.v)
        if self.gravSys.planets.index(self) != 0:
            self.setheading(self.towards(self.gravSys.planets[0]))
        self.a = self.acc()
        self.v = self.v + dt*self.a

## create compound yellow/blue turtleshape for planets

def main():
    s = Turtle()
    s.reset()
    s.tracer(0,0)
    s.ht()
    s.pu()
    s.fd(6)
    s.lt(90)
    s.begin_poly()
    s.circle(6, 180)
    s.end_poly()
    m1 = s.get_poly()
    s.begin_poly()
    s.circle(6,180)
    s.end_poly()
    m2 = s.get_poly()

    planetshape = Shape("compound")
    planetshape.addcomponent(m1,"orange")
    planetshape.addcomponent(m2,"blue")
    s.getscreen().register_shape("planet", planetshape)
    s.tracer(1,0)

    ## setup gravitational system
    gs = GravSys()
    sun = Star(1000000, Vec(0,0), Vec(0,-2.5), gs, "circle")
    sun.color("yellow")
    sun.shapesize(1.8)
    sun.pu()
    earth = Star(12500, Vec(210,0), Vec(0,195), gs, "planet")
    earth.pencolor("green")
    earth.shapesize(0.8)
    moon = Star(1, Vec(220,0), Vec(0,295), gs, "planet")
    moon.pencolor("blue")
    moon.shapesize(0.5)
    gs.init()
    gs.start()
    return "Done!"

if __name__ == '__main__':
    main()
    mainloop()
PK�%�Z�ʏ
�
�
tdemo_penrose.pynuȯ��#! /usr/bin/python2.7
"""       xturtle-example-suite:

          xtx_kites_and_darts.py

Constructs two aperiodic penrose-tilings,
consisting of kites and darts, by the method
of inflation in six steps.

Starting points are the patterns "sun"
consisting of five kites and "star"
consisting of five darts.

For more information see:
 http://en.wikipedia.org/wiki/Penrose_tiling
 -------------------------------------------
"""
from turtle import *
from math import cos, pi
from time import clock, sleep

f = (5**0.5-1)/2.0   # (sqrt(5)-1)/2 -- golden ratio
d = 2 * cos(3*pi/10)

def kite(l):
    fl = f * l
    lt(36)
    fd(l)
    rt(108)
    fd(fl)
    rt(36)
    fd(fl)
    rt(108)
    fd(l)
    rt(144)

def dart(l):
    fl = f * l
    lt(36)
    fd(l)
    rt(144)
    fd(fl)
    lt(36)
    fd(fl)
    rt(144)
    fd(l)
    rt(144)

def inflatekite(l, n):
    if n == 0:
        px, py = pos()
        h, x, y = int(heading()), round(px,3), round(py,3)
        tiledict[(h,x,y)] = True
        return
    fl = f * l
    lt(36)
    inflatedart(fl, n-1)
    fd(l)
    rt(144)
    inflatekite(fl, n-1)
    lt(18)
    fd(l*d)
    rt(162)
    inflatekite(fl, n-1)
    lt(36)
    fd(l)
    rt(180)
    inflatedart(fl, n-1)
    lt(36)

def inflatedart(l, n):
    if n == 0:
        px, py = pos()
        h, x, y = int(heading()), round(px,3), round(py,3)
        tiledict[(h,x,y)] = False
        return
    fl = f * l
    inflatekite(fl, n-1)
    lt(36)
    fd(l)
    rt(180)
    inflatedart(fl, n-1)
    lt(54)
    fd(l*d)
    rt(126)
    inflatedart(fl, n-1)
    fd(l)
    rt(144)

def draw(l, n, th=2):
    clear()
    l = l * f**n
    shapesize(l/100.0, l/100.0, th)
    for k in tiledict:
        h, x, y = k
        setpos(x, y)
        setheading(h)
        if tiledict[k]:
            shape("kite")
            color("black", (0, 0.75, 0))
        else:
            shape("dart")
            color("black", (0.75, 0, 0))
        stamp()

def sun(l, n):
    for i in range(5):
        inflatekite(l, n)
        lt(72)

def star(l,n):
    for i in range(5):
        inflatedart(l, n)
        lt(72)

def makeshapes():
    tracer(0)
    begin_poly()
    kite(100)
    end_poly()
    register_shape("kite", get_poly())
    begin_poly()
    dart(100)
    end_poly()
    register_shape("dart", get_poly())
    tracer(1)

def start():
    reset()
    ht()
    pu()
    makeshapes()
    resizemode("user")

def test(l=200, n=4, fun=sun, startpos=(0,0), th=2):
    global tiledict
    goto(startpos)
    setheading(0)
    tiledict = {}
    a = clock()
    tracer(0)
    fun(l, n)
    b = clock()
    draw(l, n, th)
    tracer(1)
    c = clock()
    print "Calculation:   %7.4f s" % (b - a)
    print "Drawing:  %7.4f s" % (c - b)
    print "Together: %7.4f s" % (c - a)
    nk = len([x for x in tiledict if tiledict[x]])
    nd = len([x for x in tiledict if not tiledict[x]])
    print "%d kites and %d darts = %d pieces." % (nk, nd, nk+nd)

def demo(fun=sun):
    start()
    for i in range(8):
        a = clock()
        test(300, i, fun)
        b = clock()
        t = b - a
        if t < 2:
            sleep(2 - t)

def main():
    #title("Penrose-tiling with kites and darts.")
    mode("logo")
    bgcolor(0.3, 0.3, 0)
    demo(sun)
    sleep(2)
    demo(star)
    pencolor("black")
    goto(0,-200)
    pencolor(0.7,0.7,1)
    write("Please wait...",
          align="center", font=('Arial Black', 36, 'bold'))
    test(600, 8, startpos=(70, 117))
    return "Done"

if __name__ == "__main__":
    msg = main()
    mainloop()
PK�%�Z�j�N=	=	tdemo_colormixer.pycnu�[����
��^c@slddlmZmZmZdefd��YZd�Zd�Zedkrhe�ZeGHe�ndS(i����(tScreentTurtletmainlooptColorTurtlecBseZd�Zd�ZRS(cCstj|�|jd�|jd�|jddd�|jd�dddg|_||_||j|<|j|j�|j	d�|j
d�|j�|j|d�|j
�|jd�|j�|j|�|jd	�|j|j�dS(
Ntturtletuseriii
iiZitgray25(Rt__init__tshapet
resizemodet	shapesizetpensizet_colortxtcolortspeedtlefttputgototpdtsetytpencolortondragtshift(tselfR
ty((s4/usr/lib64/python2.7/Demo/turtle/tdemo_colormixer.pyRs&



	








cCsP|jtdt|d���|j�|j|j<|j|j�t�dS(Nii(RtmaxtmintycorRR
t	fillcolort
setbgcolor(RR
R((s4/usr/lib64/python2.7/Demo/turtle/tdemo_colormixer.pyRs(t__name__t
__module__RR(((s4/usr/lib64/python2.7/Demo/turtle/tdemo_colormixer.pyRs	cCs)tjtj�tj�tj��dS(N(tscreentbgcolortredRtgreentblue(((s4/usr/lib64/python2.7/Demo/turtle/tdemo_colormixer.pyR"sc	Cs�t�atjd�tjdddd�tdd�atdd�atdd�at�t	�}|j
�|j�|jdd	�|j
d
ddd
dddf�dS(Nii����g333333ӿig�������?g�?iigffffff�?sDRAG!taligntcentertfonttArialitboldtitalict	EVENTLOOP(R*R+(RR!tdelaytsetworldcoordinatesRR#R$R%RRthtRRtwrite(twriter((s4/usr/lib64/python2.7/Demo/turtle/tdemo_colormixer.pytmain%s	
	

"t__main__N(	RRRRRRR2Rtmsg(((s4/usr/lib64/python2.7/Demo/turtle/tdemo_colormixer.pyt<module>s			PK�%�Z}��W�$�$
tdemo_nim.pycnu�[����
��^c@s5dZddlZddlZddlZdZdZdZdZedZeedd	edd
Z	dZ
dZdZd�Z
d�Zd�Zdefd��YZdejfd��YZdefd��YZdefd��YZdefd��YZd�Zedkr1e�ej�ndS( s�      turtle-example-suite:

            tdemo_nim.py

Play nim against the computer. The player
who takes the last stick is the winner.

Implements the model-view-controller
design pattern.
i����Ni�i�iiiiiii?i�i�cCstjtt�S(N(trandomtrandintt	MINSTICKSt	MAXSTICKS(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyt	randomrowscCsy|d|dA|dA}|dkr0t|�SxBtd�D]4}|||A}|||kr=||f}|Sq=WdS(Niiii(t
randommovetrange(tstatetxoredtztstmove((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pytcomputerzug!s
cCsot|�}x6trDtjdd�}|||dkkrPqqWtj|dk||d�}||fS(Niii(tmaxtTrueRR(RtmR	trand((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR+s	 tNimModelcBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs
||_dS(N(tgame(tselfR((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyt__init__6scCsr|jjtjtjgkr"dSt�t�t�g|_d|_d|_	|jj
j�tj|j_dS(Ni(
RRtNimtCREATEDtOVERRtstickstplayertNonetwinnertviewtsetuptRUNNING(R((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR9s		cCs�|j|}||j|<|jjj||||j�|j�rstj|j_|j|_	|jjj
�nI|jdkr�d|_t|j�\}}|j||�d|_ndS(Nii(
RRRtnotify_moveRt	game_overRRRRtnotify_overRR(Rtrowtcolt	maxspalte((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRBs

	cCs|jdddgkS(Ni(R(R((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR PscCs+|j||krdS|j||�dS(N(RR(RR"R#((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRSs(t__name__t
__module__RRRR R(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR5s
					tStickcBs#eZd�Zd�Zd�ZRS(cCs�tjj|dt�||_||_||_|j||�\}}|jd�|j	t
dtd�|jd�|j
�|j||�|jd�|j�dS(Ntvisibletsquareg$@g4@itwhite(tturtletTurtleRtFalseR"R#Rtcoordstshapet	shapesizetHUNITtWUNITtspeedtputgototcolort
showturtle(RR"R#Rtxty((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRZs			



cCskt|d�\}}dd|d|t}dd|t}|tdtdtd|tdfS(Niiii(tdivmodR2R1tSCREENWIDTHtSCREENHEIGHT(RR"R#tpackett	remainderR8R9((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR.hscCs9|jjtjkrdS|jjj|j|j�dS(N(RRRRt
controllerRR"R#(RR8R9((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pytmakemovens(R%R&RR.R@(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR'Ys		tNimViewcBsAeZd�Zdd�Zd�Zd�Zd�Zd�ZRS(cCs�||_|j|_|j|_|jjd�|jjt�|jjd�tjdt�|_	|j	j
�|j	jd�i|_xJt
d�D]<}x3t
t�D]%}t|||�|j||f<q�Wq�W|jd�|jjt�dS(Ni�i�R(iis... a moment please ...(i�i�i�(Rtscreentmodelt	colormodettracerR-tbgcolorR+R,twriterR4R3RRRR'tdisplayR(RRR"R#((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRus	
	'
cCs�|jjt�|jj�|dk	rt|jjdtdd�|jjd�|jj	|dddd�n|jjdtdd�|jjd�|jj	|dddd�|jjt
�dS(Niii0tredtaligntcentertfonttCourieritbolditblacki(RMiRN(RMiRN(RBRER-RGtclearRR5R<tpencolortwriteR(Rtmsg1tmsg2((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRH�s
cCs�|jjt�xOtd�D]A}x8t|jj|�D] }|j||fjt�q:WqWxRtd�D]D}x;t|jj|t�D] }|j||fjd�q�WqoW|j	d�|jjt
�dS(NiR*s*Your turn! Click leftmost stick to remove.(RBRER-RRCRR6tSCOLORRRHR(RR"R#((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s" "
cCs�|dkrIt}x�t||�D] }|j||fj|�q"Wn�|jd�tjd�|jd�t}xIt|d|dd�D]-}tjd�|j||fj|�q�W|jd�dS(	Nis ... thinking ...         g�?s ... thinking ... aaah ...ii����g�������?s*Your turn! Click leftmost stick to remove.(tHCOLORRRR6RHttimetsleeptCOLOR(RR"R#R$RtfarbeR
((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s!


!
cCs8|jjjdkrd}nd}|jd|�dS(NisCongrats. You're the winner!!!s"Sorry, the computer is the winner.s2To play again press space bar. To leave press ESC.(RRCRRH(RRT((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR!�s	cCs)|jjtjkr%|jj�ndS(N(RRRRRBRP(R((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRP�sN(	R%R&RRRHRRR!RP(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRAts	
			t
NimControllercBseZd�Zd�ZRS(cCs�||_|jj|_t|_x'|jj�D]}|j|j�q1W|jjj	|jj
jd�|jjj	|jjjd�|jjj
d�|jjj�dS(NtspacetEscapesPress space bar to start game(RRRR-tBUSYtvaluestonclickR@RBtonkeyRCRRPRHtlisten(RRtstick((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s		cCs9|jr
dSt|_|jjj||�t|_dS(N(R^RRRCRR-(RR"R#((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s
		(R%R&RR(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR[�s	RcBs#eZdZdZdZd�ZRS(iiicCsFtj|_||_t|�|_t|�|_t|�|_	dS(N(
RRRRBRRCRARR[R?(RRB((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s
	(R%R&RRRR(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�scCs9tj�}|jd�|jtt�t|�}dS(Ntstandards
EVENTLOOP!(R+tScreentmodeRR;R<R(t
mainscreentnim((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pytmain�s

t__main__(i?i?i(i�i�i�(i�i�i�(t__doc__R+RRWR;R<RRR1R2RURVRYRRRtobjectRR,R'RAR[RRiR%tmainloop(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyt<module>
s0
		
	
$E	PK�%�Z8Hw�*�*turtleDemo.pycnu�[����
Afc@s0ddlZddlZddlTddlmZddlmZddlmZddl	Z	ddl
Z
ej�Zdej
e�kr�dGHdGeGHej�nd	Zd
ZdZdZd
ZddefZdZd Zd�Zd!d"d#fZdefd��YZd�Zedkr,e�ndS($i����N(t*(t
Percolator(tColorDelegator(t	view_files
turtleDemo.pys:Directory of turtleDemo must be current working directory!sBut in your case this isiiiiitArialitboldsLucida ConsoleitnormalcCs�gtjt�D]+}|jd�r|jd�r|^q}g}x�|D]�}|jd�rs|j|�qNtjjt|�}tjj|�|g}gtj|�D]*}|jd�r�|jd�r�|^q�}|j||�qNW|S(Nttdemo_s.pycs.py(	tostlistdirtdemo_dirt
startswithtendswithtappendtpathtjointsys(tentrytentries1tentries2Rtsubdirtscripttscripts((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pytgetExampleEntriess
	sTurtledemo helpsdemohelp.txtsAbout turtledemosabout_turtledemo.txtsAbout turtle modulesabout_turtle.txtt
DemoWindowcBs�eZdd�Zd�Zd�Zd�Zddd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�ZRS(cCst�|_}t_|jd�|jd|j�|jddd�|jddd�|jddddd�|jddddd�|jd	dddd�t	|d
t
dd�|_|j�|_
|j�|_|jjddd
ddd�tdtdddtdd�}|j|j|��|j|j|��|jddd
ddd�t|dddddddd,ddd
t�|_t|dddtd d!d"d#d$|j�|_t|dd%dtd d!d"d#d$|j�|_t|dd&dtd d!d"d#d$|j �|_!|jjddd'dddd(d-�|jjddd'ddd)�|jjddd'ddd)�|j!jddd'd	dd)�t"|j#�j$t%��t&|_'t&|_(|r�|j)|�n|j*t+t,t,t,d*d+�t-|_.dS(.NsPython turtle-graphics examplestWM_DELETE_WINDOWitweightitminsizeiZiitrelieftborderwidthtrowt
columnspanitstickytnewstorientt	sashwidthit
sashrelieftbgs#dddtheightttexts --- s#ddftfontRiRs START tfgtwhitetdisabledforegrounds#fedtcommands STOP s CLEAR tcolumntpadxtewsChoose example from menutblack(RiR(ii(/tTktroottturtlet_rootttitletwm_protocolt_destroytgrid_rowconfiguretgrid_columnconfiguretFrametRAISEDtmBartmakeLoadDemoMenutExamplesBtntmakeHelpMenut
OptionsBtntgridtPanedWindowt
HORIZONTALtSOLIDtaddt
makeTextFrametmakeGraphFrametLabeltRIDGEt
output_lbltButtontbtnfontt	startDemot	start_btntstopIttstop_btntclearCanvast	clear_btnRR'tinsertfilterRtFalsetdirtytexitflagtloadfilet	configGUItNORMALtDISABLEDtSTARTUPtstate(tselftfilenameR2tpane((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyt__init__7sR
%		
cCsf|jj�}|jj�}|jjd|j||j�|jjd|j||j�dS(Ng�?(t_canvastwinfo_widthtwinfo_heighttxview_movetot	canvwidthtyview_movetot
canvheight(R]teventtcwidthtcheight((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pytonResizehs"c
Cst|�|_}t|dddddddd�|_}t|dd	�|_}|j|d
<|jdtdt	�t|dd
dt
�|_}|j|d
<|jdt
dt�t|d<|j|d<|j|d<|jdtdtdd�|S(NtnameR'R.itwraptnonetwidthi-tvbarR,tsidetfillthbarR"R(tyscrollcommandtxscrollcommandtexpandi(R:t
text_frametTextR't	ScrollbarRptyviewtpacktLEFTtYRCRstxviewtBOTTOMtXttxtfonttsettBOTH(R]R2RwR'RpRs((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyRFns




cCs�|tj_d|_d|_tj|dd|j|j�tj_|_}|j�|jj	d|j
�d|jd<tj�|_}tj
j||j�|j|_|gtj_|S(Ni�i iXs<Configure>iR(R3t_ScreenR4ReRgtScrolledCanvasRat
adjustScrollst_rootwindowtbindRktScreentscreentTurtleScreenR`tscanvast	RawTurtletscreens(R]R2tcanvast_s_((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyRG�s		,

ttbluecCs�|jjd|�|jjd|d|tkr7dnd�|jjd|d|tkrbdnd�|jjd|d|tkr�dnd�|jjd|d|�dS(NR\R%s#d00s#fcaR'R)(R>tconfigRNRYRPRRRJ(R]tmenutstarttstoptclearttxttcolor((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyRX�scsft�jdddddt�}|jdtdd�t|�|_xt�D]}�fd	�}t|t	�r�|jj
d
|dd!dddtd
||��qP|d|d}}t|j�|j_xR|D]J}|jjj
d
|dd!dddtd
|tj
j||���q�W|jjd
|dd|jjdt�qPW|j|d<|S(NR'tExamplest	underlineiR(RqR.t2mcs��fd�}|S(Ncs�j��dS(N(RW((R]tx(s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pytemit�s((R�R�(R](R�s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pytloadexample�stlabelii����R,iR�(t
MenubuttonR<tmenufontR{R|tMenuR�Rt
isinstancetstrtadd_commandtchoicesRRRtadd_cascade(R]tCmdBtnRR�t_dirtentrieste((R]s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyR=�s(
 !
cs�t�jdddddt�}|jdtdd�t|�|_xHtD]@\}}||�fd	�}|jjd
|dtd|�qMW|j|d<|S(
NR'tHelpR�iR(RqR.R�cs&t�j|tjjt|��dS(N(RR2RRRR
(t
help_labelt	help_file(R](s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pytshow�sR�R,R�(	R�R<R�R{R|R�R�thelp_entriesR�(R]R�R�R�R�((R]s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyR?�s!#
cCs'|js
dS|jj�t|_dS(N(RUR�R�RT(R]((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyt
refreshCanvas�s	
cCs�|j�tjj|�r�tjj|�r�t|d�}|j�}|j�|jj	dd�|jj
d|�tjj|�\}}|jj
|dd!d�t|d �|_|jttttdd�t|_ndS(	Ntrs1.0tendii����s# - a Python turtle graphics examplesPress start buttontred(R�RRtexiststisdirtopentreadtcloseR'tdeletetinserttsplitR2R5t
__import__tmoduleRXRYRZtREADYR\(R]R^tftcharstdirectfname((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyRW�s
%

cCs4|j�t|_ttj_|jttttdd�|j	j
�|j	jd�t|_
y4|jj�}|dkr�t|_
n	t|_
Wn6tjk
r�|jdkr�dSt|_
d}nX|j
tkr�|jtttt|�n7|j
tkr0t|_|jttttdd�ndS(Nsdemo running...R0tstandardt	EVENTLOOPsstopped!suse mouse/keys or STOPR�(R�tTrueRUR3R�t_RUNNINGRXRZRYR�R�tmodetRUNNINGR\R�tmaintEVENTDRIVENtDONEt
TerminatorR2tNoneRV(R]tresult((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyRM�s2
	

	
	

	cCs7|j�|jjdd�|jtttt�dS(NtcursorR�(R�R�R�RXRYRZ(R]((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyRQ�s
cCsW|jrG|j�t|_|jttttdd�ttj_nttj_dS(NsSTOPPED!R�(	RVRQRTRXRYRZR3R�R�(R]((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyRO�s	
	
cCs&ttj_|jj�d|_dS(N(RTR3R�R�R2tdestroyR�(R]((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyR7s
N(t__name__t
__module__R�R`RkRFRGRXR=R?R�RWRMRQROR7(((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyR5s1					
					
cCst�}|jj�dS(N(RR2tmainloop(tdemo((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyR�s	t__main__(RiR(sLucida ConsoleiR(sTurtledemo helpsdemohelp.txt(sAbout turtledemosabout_turtledemo.txt(sAbout turtle modulesabout_turtle.txt(RRtTkintertidlelib.PercolatorRtidlelib.ColorDelegatorRtidlelib.textViewRR3ttimetgetcwdR
R	texitR[R�R�R�R�RYR�RLR�RR�tobjectRR�R�(((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyt<module>s8
	
		�	PK�%�Z���CCtdemo_wikipedia.pynu�[���"""      turtle-example-suite:

          tdemo_wikipedia3.py

This example is
inspired by the Wikipedia article on turtle
graphics. (See example wikipedia1 for URLs)

First we create (ne-1) (i.e. 35 in this
example) copies of our first turtle p.
Then we let them perform their steps in
parallel.

Followed by a complete undo().
"""
from turtle import Screen, Turtle, mainloop
from time import clock, sleep

def mn_eck(p, ne,sz):
    turtlelist = [p]
    #create ne-1 additional turtles
    for i in range(1,ne):
        q = p.clone()
        q.rt(360.0/ne)
        turtlelist.append(q)
        p = q
    for i in range(ne):
        c = abs(ne/2.0-i)/(ne*.7)
        # let those ne turtles make a step
        # in parallel:
        for t in turtlelist:
            t.rt(360./ne)
            t.pencolor(1-c,0,c)
            t.fd(sz)

def main():
    s = Screen()
    s.bgcolor("black")
    p=Turtle()
    p.speed(0)
    p.hideturtle()
    p.pencolor("red")
    p.pensize(3)

    s.tracer(36,0)

    at = clock()
    mn_eck(p, 36, 19)
    et = clock()
    z1 = et-at

    sleep(1)

    at = clock()
    while any([t.undobufferentries() for t in s.turtles()]):
        for t in s.turtles():
            t.undo()
    et = clock()
    return "Laufzeit: %.3f sec" % (z1+et-at)


if __name__ == '__main__':
    msg = main()
    print msg
    mainloop()
PK�%�Z��!KKtdemo_tree.pyonu�[����
Afc@sodZddlmZmZddlmZd�Zd�Zd�Ze	dkrke�Z
e
GHe�ndS(	s�      turtle-example-suite:

             tdemo_tree.py

Displays a 'breadth-first-tree' - in contrast
to the classical Logo tree drawing programs,
which use a depth-first-algorithm.

Uses:
(1) a tree-generator, where the drawing is
quasi the side-effect, whereas the generator
always yields None.
(2) Turtle-cloning: At each branching point
the current pen is cloned. So in the end
there are 1024 turtles.
i����(tTurtletmainloop(tclockccs�|dkr�g}x[|D]S}|j|�|j�}|j|�|j|�|j|�|j|�qWx)t|||||�D]}dVq�WndS(s� plist is list of pens
    l is length of branch
    a is half of the angle between 2 branches
    f is factor by which branch is shortened
    from level to level.iN(tforwardtclonetlefttrighttappendttreetNone(tplisttltatftlsttptqtx((s./usr/lib64/python2.7/Demo/turtle/tdemo_tree.pyRs




 cCs�t�}|jd�|j�|jd�|jdd�|jd�|j�|jd�|j	�t
|gddd�}x|D]}q�Wt|j�j
��GHdS(NiiiZi.���i�iAgffffff�?(Rt
setundobufferR	t
hideturtletspeedttracerRtpenupRtpendownRtlent	getscreentturtles(RttR((s./usr/lib64/python2.7/Demo/turtle/tdemo_tree.pytmaketree's	







cCs%t�}t�t�}d||S(Nsdone: %.2f sec.(RR(Rtb((s./usr/lib64/python2.7/Demo/turtle/tdemo_tree.pytmain6s		t__main__N(t__doc__tturtleRRttimeRRRRt__name__tmsg(((s./usr/lib64/python2.7/Demo/turtle/tdemo_tree.pyt<module>s				PK�%�Z�ʭ��
�
tdemo_fractalcurves.pyonu�[����
Afc@smdZddlTddlmZmZdefd��YZd�Zedkrie�Z	e	GHe
�ndS(	s&      turtle-example-suite:

        tdemo_fractalCurves.py

This program draws two fractal-curve-designs:
(1) A hilbert curve (in a box)
(2) A combination of Koch-curves.

The CurvesTurtle class and the fractal-curve-
methods are taken from the PythonCard example
scripts for turtle-graphics.
i����(t*(tsleeptclocktCurvesTurtlecBs#eZd�Zd�Zd�ZRS(cCs�|dkrdS|j|d�|j||d|�|j|�|j|d�|j||d|�|j|�|j||d|�|j|d�|j|�|j||d|�|j|d�dS(NiiZi(tleftthilberttforwardtright(tselftsizetleveltparity((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyRs


cCs�ddl}d||j|j|�}|j�|j|�|j�|jdd|d|�x8t|�D]*}|j|||�|jd|�quW|j	dd|d|�|j�|j
|�|j�dS(Ni����ii�iZih(tmathtsintpitputfdtpdtrttrangetfractaltlttbk(RtntradtlevtdirRtedgeti((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyt
fractalgon/s




cCs�|dkr|j|�dS|j|d|d|�|jd|�|j|d|d|�|jd|�|j|d|d|�|jd|�|j|d|d|�dS(Niii<ix(RRRR(RtdisttdepthR((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyRBs
(t__name__t
__module__RRR(((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyRs		cCsrt�}|j�|jd�|j�|jdd�|j�d}|jd|d|�|j�t�}|j	d�|j
t�|j|�|j
|dd�|j|�x:td�D],}|jd�|j|d	|d
�q�W|j�x.td
�D] }|j|�|jd�qW|j�x:td�D],}|j|d|d
�|jd�qKW|j
t�t�}d
||}td�|j�|jd�|j�|jdd�t�}|jdd�|j
t�|jdddd�|j
t�|jd�|jdddd�|j
t�t�}|d||7}|S(Niiii���i��trediiZi@iiiBsHilbert: %.2fsec. tblacktbluei�i�i����sKoch: %.2fsec.(RtresettspeedthtttracerRtsetposRRt	fillcolortfilltTrueRRRRRtFalseRtcolorR(tftR	ttaRttbtres((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pytmainNsZ	




	








	



	



	t__main__N(t__doc__tturtlettimeRRtPenRR3R tmsgtmainloop(((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyt<module>
s
=	8	PK�%�Zؿy��
�
about_turtle.txtnu�[���
========================================================
                       A new turtle module for Python
========================================================

Turtle graphics is a popular way for introducing programming to
kids. It was part of the original Logo programming language developed
by Wally Feurzig and Seymour Papert in 1966.

Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an ``import turtle``, 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.right(25), and it rotates in-place 25 degrees clockwise.

By combining together these and similar commands, intricate shapes and
pictures can easily be drawn.

----- turtle.py

This module is an extended reimplementation of turtle.py from the
Python standard distribution up to Python 2.5. (See: http:\\www.python.org)

It tries to keep the merits of turtle.py and to be (nearly) 100%
compatible with it. This means in the first place to enable the
learning programmer to use all the commands, classes and methods
interactively when using the module from within IDLE run with
the -n switch.

Roughly it has the following features added:

- Better animation of the turtle movements, especially of turning the
  turtle. So the turtles can more easily be used as a visual feedback
  instrument by the (beginning) programmer.

- Different turtle shapes, gif-images as turtle shapes, user defined
  and user controllable turtle shapes, among them compound
  (multicolored) shapes. Turtle shapes can be stgretched and tilted, which
  makes turtles zu very versatile geometrical objects.

- Fine control over turtle movement and screen updates via delay(),
  and enhanced tracer() and speed() methods.

- Aliases for the most commonly used commands, like fd for forward etc.,
  following the early Logo traditions. This reduces the boring work of
  typing long sequences of commands, which often occur in a natural way
  when kids try to program fancy pictures on their first encounter with
  turtle graphcis.

- Turtles now have an undo()-method with configurable undo-buffer.

- Some simple commands/methods for creating event driven programs
  (mouse-, key-, timer-events). Especially useful for programming games.
  
- A scrollable Canvas class. The default scrollable Canvas can be
  extended interactively as needed while playing around with the turtle(s).

- A TurtleScreen class with methods controlling background color or
  background image, window and canvas size and other properties of the
  TurtleScreen.

- There is a method, setworldcoordinates(), to install a user defined
  coordinate-system for the TurtleScreen. 

- The implementation uses a 2-vector class named Vec2D, derived from tuple.
  This class is public, so it can be imported by the application programmer,
  which makes certain types of computations very natural and compact.

- Appearance of the TurtleScreen and the Turtles at startup/import can be
  configured by means of a turtle.cfg configuration file.
  The default configuration mimics the appearance of the old turtle module.

- If configured appropriately the module reads in docstrings from a docstring
  dictionary in some different language, supplied separately  and replaces
  the english ones by those read in. There is a utility function
  write_docstringdict() to write a dictionary with the original (english)
  docstrings to disc, so it can serve as a template for translations.

PK�%�Z:�B�mmtdemo_paint.pycnu�[����
Afc@s_dZddlTddd�Zddd�Zd�Zedkr[e�ZeGHe�ndS(	sp       turtle-example-suite:

            tdemo_paint.py

A simple  event-driven paint program

- left mouse button moves turtle
- middle mouse button changes color
- right mouse button toogles betweem pen up
(no line drawn when the turtle moves) and
pen down (line is drawn). If pen up follows
at least two pen-down moves, the polygon that
includes the starting point is filled.
 -------------------------------------------
 Play around by clicking into the canvas
 using all three mouse buttons.
 -------------------------------------------
          To exit press STOP button
 -------------------------------------------
i����(t*icCs0t�drt�t�nt�t�dS(Ntpendown(tpentend_filltuptdownt
begin_fill(txty((s//usr/lib64/python2.7/Demo/turtle/tdemo_paint.pytswitchupdowns


cCs$tdtd attd�dS(Nii(tcolorstcolor(RR((s//usr/lib64/python2.7/Demo/turtle/tdemo_paint.pytchangecolor scCsztd�td�td�td�ddddgattd	�t�ttd
�tt	d�ttd�dS(
Ntcircletuserg�?itredtgreentbluetyellowiiit	EVENTLOOP(
tshapet
resizemodet	shapesizetwidthR
RR	t
onscreenclicktgotoR(((s//usr/lib64/python2.7/Demo/turtle/tdemo_paint.pytmain%s






t__main__N(t__doc__tturtleR	RRt__name__tmsgtmainloop(((s//usr/lib64/python2.7/Demo/turtle/tdemo_paint.pyt<module>s
		PK�%�Z�z���demohelp.txtnu�[���

  ----------------------------------------------

      turtleDemo - Help

  ----------------------------------------------

  This document has two sections:

  (1) How to use the demo viewer
  (2) How to add your own demos to the demo repository


  (1) How to use the demo viewer.

  Select a demoscript from the example menu.
  The (syntax colored) source code appears in the left
  source code window. IT CANNOT BE EDITED, but ONLY VIEWED!

  - Press START button to start the demo.
  - Stop execution by pressing the STOP button.
  - Clear screen by pressing the CLEAR button.
  - Restart by pressing the START button again.

  SPECIAL demos are those which run EVENTDRIVEN.
  (For example clock.py - or oldTurtleDemo.py which
  in the end expects a mouse click.):

      Press START button to start the demo.

      - Until the EVENTLOOP is entered everything works
      as in an ordinary demo script.

      - When the EVENTLOOP is entered, you control the
      application by using the mouse and/or keys (or it's
      controlled by some timer events)
      To stop it you can and must press the STOP button.

      While the EVENTLOOP is running, the examples menu is disabled.

      - Only after having pressed the STOP button, you may
      restart it or choose another example script.

   * * * * * * * *
   In some rare situations there may occur interferences/conflicts
   between events concerning the demo script and those concerning the
   demo-viewer. (They run in the same process.) Strange behaviour may be
   the consequence and in the worst case you must close and restart the
   viewer.
   * * * * * * * *


   (2) How to add your own demos to the demo repository
     IMPORTANT! When imported, the demo should not modify the system
     by calling functions in other modules, such as sys, tkinter, or
     turtle. Global variables should be initialized in main().

   - The script name must begin with tdemo_ ,
     so it must have the form tdemo_<your-script-name>.py

   - The code must contain a main() function which will
     be executed by the viewer (see provided example scripts).
     It may return a string which will be displayed in the Label below
     the source code window (when execution has finished.)
	   
   - In order to run mydemo.py by itself, such as during development,
     add the following at the end of the file:

    if __name__ == '__main__':
        main()
        mainloop()  # keep window 

    python -m turtledemo.mydemo  # will then run it

   - If the demo is EVENT DRIVEN, main must return the string
     "EVENTLOOP". This informs the demo viewer that the script is
     still running and must be stopped by the user!

     If an "EVENTLOOP" demo runs by itself, as with clock, which uses
     ontimer, or minimal_hanoi, which loops by recursion, then the
     code should catch the turtle.Terminator exception that will be
     raised when the user presses the STOP button.  (Paint is not such
     a demo; it only acts in response to mouse clicks and movements.)
PK�%�Z�g��tdemo_lindenmayer_indian.pycnu�[����
Afc@sSdZddlTd�Zd�Zd�ZedkrOe�ZeGHe�ndS(s�       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

i����(t*cCsNxGt|�D]9}d}x$|D]}||j||�}q W|}q
W|S(Nt(trangetget(tseqtreplacementRulestntitnewseqtelement((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytreplaces

cCsWxP|D]H}y||�Wqtk
rNyt|||�WqOqOXqXqWdS(N(t	TypeErrortdraw(tcommandstrulestb((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pyR&s

cCsrd�}d�}d�}i|d6|d6|d6dd6}id	d6}d
}t||d�}t�td�tdd
�t�t�td�t�t||�ddl	m
}|d�d�}d�}	d�}
i|d6|	d6|
d6}idd6dd6}d}
t�td
�tdd
�t�td�t|
|d�}t||�td�dS(NcSstd�dS(Ni-(tright(((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytr7scSstd�dS(Ni-(tleft(((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytl:scSstd�dS(Ng@(tforward(((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytf=st-t+Rsf+f+f--f--f+f+fRsb+f+b--f--b+f+bs
b--f--b--fiiii�i����(tsleepcSstd�tdd�dS(Ntredi
iZ(tcolortcircle(((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytAVs
cSsOddlm}td�d|d�}t|�t|d�t|�dS(Ni����(tsqrttblackiii(tmathRRRR(RR((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytBZs


cSstd�td�dS(Ntgreeni
(RR(((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytFbs
tatafbfat	afbfbfbfatfbfbfbfbi-sDone!(R
tresettspeedttracerthttuptbackwardtdownRttimeRR(RRRtsnake_rulestsnake_replacementRulestsnake_starttdrawingRRR R"t
krishna_rulestkrishna_replacementRulest
krishna_start((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytmain1s@			"





			




t__main__N(t__doc__tturtleR
RR6t__name__tmsgtmainloop(((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pyt<module>s
			C	PK�%�Zu��Ucctdemo_two_canvases.pycnu�[����
��^c@sOdZddlmZmZmZd�ZedkrKe�ej�ndS(s�turtledemo.two_canvases

Use TurtleScreen and RawTurtle to draw on two
distinct canvases in a separate windows. The
new window must be separately closed in
addition to pressing the STOP button.
i����(tTurtleScreent	RawTurtletTKc	Cs�tj�}tj|dddddd�}tj|dddddd�}|j�|j�t|�}|jddd	�t|�}|jd	dd�t|�}t|�}|jd
d�|jd�|jdd�|jd�x.||fD] }|j	d
�|j
d�q�W|j
d�x||fD]}|j�q=WxEtd�D]7}x.||fD] }|j
d�|j
d�qqWq^WxB||fD]4}|j�|j
d�|j�|jd�q�WdS(Ntwidthi,theighti�tbgs#ddffffs#ffeeeeg333333�?itreditbluetturtlei$i�ii2iHi6t	EVENTLOOP(ig333333�?g333333�?(g333333�?g333333�?i(RtTktCanvastpackRtbgcolorRtcolorRtshapetltt
begin_filltrangetfdtend_filltputbk(	troottcv1tcv2ts1ts2tptqttti((s6/usr/lib64/python2.7/Demo/turtle/tdemo_two_canvases.pytmains>!!









t__main__N(t__doc__RRRRR t__name__tmainloop(((s6/usr/lib64/python2.7/Demo/turtle/tdemo_two_canvases.pyt<module>s
	)PK�%�ZH�B�		tdemo_paint.pynuȯ��#! /usr/bin/python2.7
"""       turtle-example-suite:

            tdemo_paint.py

A simple  event-driven paint program

- left mouse button moves turtle
- middle mouse button changes color
- right mouse button toogles betweem pen up
(no line drawn when the turtle moves) and
pen down (line is drawn). If pen up follows
at least two pen-down moves, the polygon that
includes the starting point is filled.
 -------------------------------------------
 Play around by clicking into the canvas
 using all three mouse buttons.
 -------------------------------------------
          To exit press STOP button
 -------------------------------------------
"""
from turtle import *

def switchupdown(x=0, y=0):
    if pen()["pendown"]:
        end_fill()
        up()
    else:
        down()
        begin_fill()

def changecolor(x=0, y=0):
    global colors
    colors = colors[1:]+colors[:1]
    color(colors[0])

def main():
    global colors
    shape("circle")
    resizemode("user")
    shapesize(.5)
    width(3)
    colors=["red", "green", "blue", "yellow"]
    color(colors[0])
    switchupdown()
    onscreenclick(goto,1)
    onscreenclick(changecolor,2)
    onscreenclick(switchupdown,3)
    return "EVENTLOOP"

if __name__ == "__main__":
    msg = main()
    print msg
    mainloop()
PK�%�Z�{P�tdemo_minimal_hanoi.pynuȯ��#! /usr/bin/python2.7
"""       turtle-example-suite:

         tdemo_minimal_hanoi.py

A minimal 'Towers of Hanoi' animation:
A tower of 6 discs is transferred from the
left to the right peg.

An imho quite elegant and concise
implementation using a tower class, which
is derived from the built-in type list.

Discs are turtles with shape "square", but
stretched to rectangles by shapesize()
 ---------------------------------------
       To exit press STOP button
 ---------------------------------------
"""
from turtle import *

class Disc(Turtle):
    def __init__(self, n):
        Turtle.__init__(self, shape="square", visible=False)
        self.pu()
        self.shapesize(1.5, n*1.5, 2) # square-->rectangle
        self.fillcolor(n/6., 0, 1-n/6.)
        self.st()

class Tower(list):
    "Hanoi tower, a subclass of built-in type list"
    def __init__(self, x):
        "create an empty tower. x is x-position of peg"
        self.x = x
    def push(self, d):
        d.setx(self.x)
        d.sety(-150+34*len(self))
        self.append(d)
    def pop(self):
        d = list.pop(self)
        d.sety(150)
        return d

def hanoi(n, from_, with_, to_):
    if n > 0:
        hanoi(n-1, from_, to_, with_)
        to_.push(from_.pop())
        hanoi(n-1, with_, from_, to_)

def play():
    onkey(None,"space")
    clear()
    try:
        hanoi(6, t1, t2, t3)
        write("press STOP button to exit",
              align="center", font=("Courier", 16, "bold"))
    except Terminator:
        pass  # turtledemo user pressed STOP

def main():
    global t1, t2, t3
    ht(); penup(); goto(0, -225)   # writer turtle
    t1 = Tower(-250)
    t2 = Tower(0)
    t3 = Tower(250)
    # make tower of 6 discs
    for i in range(6,0,-1):
        t1.push(Disc(i))
    # prepare spartanic user interface ;-)
    write("press spacebar to start game",
          align="center", font=("Courier", 16, "bold"))
    onkey(play, "space")
    listen()
    return "EVENTLOOP"

if __name__=="__main__":
    msg = main()
    print msg
    mainloop()
PK�%�Z�j�N=	=	tdemo_colormixer.pyonu�[����
��^c@slddlmZmZmZdefd��YZd�Zd�Zedkrhe�ZeGHe�ndS(i����(tScreentTurtletmainlooptColorTurtlecBseZd�Zd�ZRS(cCstj|�|jd�|jd�|jddd�|jd�dddg|_||_||j|<|j|j�|j	d�|j
d�|j�|j|d�|j
�|jd�|j�|j|�|jd	�|j|j�dS(
Ntturtletuseriii
iiZitgray25(Rt__init__tshapet
resizemodet	shapesizetpensizet_colortxtcolortspeedtlefttputgototpdtsetytpencolortondragtshift(tselfR
ty((s4/usr/lib64/python2.7/Demo/turtle/tdemo_colormixer.pyRs&



	








cCsP|jtdt|d���|j�|j|j<|j|j�t�dS(Nii(RtmaxtmintycorRR
t	fillcolort
setbgcolor(RR
R((s4/usr/lib64/python2.7/Demo/turtle/tdemo_colormixer.pyRs(t__name__t
__module__RR(((s4/usr/lib64/python2.7/Demo/turtle/tdemo_colormixer.pyRs	cCs)tjtj�tj�tj��dS(N(tscreentbgcolortredRtgreentblue(((s4/usr/lib64/python2.7/Demo/turtle/tdemo_colormixer.pyR"sc	Cs�t�atjd�tjdddd�tdd�atdd�atdd�at�t	�}|j
�|j�|jdd	�|j
d
ddd
dddf�dS(Nii����g333333ӿig�������?g�?iigffffff�?sDRAG!taligntcentertfonttArialitboldtitalict	EVENTLOOP(R*R+(RR!tdelaytsetworldcoordinatesRR#R$R%RRthtRRtwrite(twriter((s4/usr/lib64/python2.7/Demo/turtle/tdemo_colormixer.pytmain%s	
	

"t__main__N(	RRRRRRR2Rtmsg(((s4/usr/lib64/python2.7/Demo/turtle/tdemo_colormixer.pyt<module>s			PK�%�Z�:8�''tdemo_yinyang.pynuȯ��#! /usr/bin/python2.7
"""       turtle-example-suite:

            tdemo_yinyang.py

Another drawing suitable as a beginner's
programming example.

The small circles are drawn by the circle
command.

"""

from turtle import *

def yin(radius, color1, color2):
    width(3)
    color("black")
    fill(True)
    circle(radius/2., 180)
    circle(radius, 180)
    left(180)
    circle(-radius/2., 180)
    color(color1)
    fill(True)
    color(color2)
    left(90)
    up()
    forward(radius*0.375)
    right(90)
    down()
    circle(radius*0.125)
    left(90)
    fill(False)
    up()
    backward(radius*0.375)
    down()
    left(90)

def main():
    reset()
    yin(200, "white", "black")
    yin(200, "black", "white")
    ht()
    return "Done!"

if __name__ == '__main__':
    main()
    mainloop()
PK�%�Z�S�;Q
Q
tdemo_fractalcurves.pynuȯ��#! /usr/bin/python2.7
"""      turtle-example-suite:

        tdemo_fractalCurves.py

This program draws two fractal-curve-designs:
(1) A hilbert curve (in a box)
(2) A combination of Koch-curves.

The CurvesTurtle class and the fractal-curve-
methods are taken from the PythonCard example
scripts for turtle-graphics.
"""
from turtle import *
from time import sleep, clock

class CurvesTurtle(Pen):
    # example derived from
    # Turtle Geometry: The Computer as a Medium for Exploring Mathematics
    # by Harold Abelson and Andrea diSessa
    # p. 96-98
    def hilbert(self, size, level, parity):
        if level == 0:
            return
        # rotate and draw first subcurve with opposite parity to big curve
        self.left(parity * 90)
        self.hilbert(size, level - 1, -parity)
        # interface to and draw second subcurve with same parity as big curve
        self.forward(size)
        self.right(parity * 90)
        self.hilbert(size, level - 1, parity)
        # third subcurve
        self.forward(size)
        self.hilbert(size, level - 1, parity)
        # fourth subcurve
        self.right(parity * 90)
        self.forward(size)
        self.hilbert(size, level - 1, -parity)
        # a final turn is needed to make the turtle
        # end up facing outward from the large square
        self.left(parity * 90)

    # Visual Modeling with Logo: A Structural Approach to Seeing
    # by James Clayson
    # Koch curve, after Helge von Koch who introduced this geometric figure in 1904
    # p. 146
    def fractalgon(self, n, rad, lev, dir):
        import math

        # if dir = 1 turn outward
        # if dir = -1 turn inward
        edge = 2 * rad * math.sin(math.pi / n)
        self.pu()
        self.fd(rad)
        self.pd()
        self.rt(180 - (90 * (n - 2) / n))
        for i in range(n):
            self.fractal(edge, lev, dir)
            self.rt(360 / n)
        self.lt(180 - (90 * (n - 2) / n))
        self.pu()
        self.bk(rad)
        self.pd()

    # p. 146
    def fractal(self, dist, depth, dir):
        if depth < 1:
            self.fd(dist)
            return
        self.fractal(dist / 3, depth - 1, dir)
        self.lt(60 * dir)
        self.fractal(dist / 3, depth - 1, dir)
        self.rt(120 * dir)
        self.fractal(dist / 3, depth - 1, dir)
        self.lt(60 * dir)
        self.fractal(dist / 3, depth - 1, dir)

def main():
    ft = CurvesTurtle()

    ft.reset()
    ft.speed(0)
    ft.ht()
    ft.tracer(1,0)
    ft.pu()

    size = 6
    ft.setpos(-33*size, -32*size)
    ft.pd()

    ta=clock()
    ft.fillcolor("red")
    ft.fill(True)
    ft.fd(size)

    ft.hilbert(size, 6, 1)

    # frame
    ft.fd(size)
    for i in range(3):
        ft.lt(90)
        ft.fd(size*(64+i%2))
    ft.pu()
    for i in range(2):
        ft.fd(size)
        ft.rt(90)
    ft.pd()
    for i in range(4):
        ft.fd(size*(66+i%2))
        ft.rt(90)
    ft.fill(False)
    tb=clock()
    res =  "Hilbert: %.2fsec. " % (tb-ta)

    sleep(3)

    ft.reset()
    ft.speed(0)
    ft.ht()
    ft.tracer(1,0)

    ta=clock()
    ft.color("black", "blue")
    ft.fill(True)
    ft.fractalgon(3, 250, 4, 1)
    ft.fill(True)
    ft.color("red")
    ft.fractalgon(3, 200, 4, -1)
    ft.fill(False)
    tb=clock()
    res +=  "Koch: %.2fsec." % (tb-ta)
    return res

if __name__  == '__main__':
    msg = main()
    print msg
    mainloop()
PK�%�Z�3'vuutdemo_penrose.pyonu�[����
Afc@sdZddlTddlmZmZddlmZmZddZd	ed
ed�Z	d�Z
d
�Zd�Zd�Z
d	d�Zd�Zd�Zd�Zd�Zddedd	d�Zed�Zd�Zedkr�e�Ze�ndS( s�       xturtle-example-suite:

          xtx_kites_and_darts.py

Constructs two aperiodic penrose-tilings,
consisting of kites and darts, by the method
of inflation in six steps.

Starting points are the patterns "sun"
consisting of five kites and "star"
consisting of five darts.

For more information see:
 http://en.wikipedia.org/wiki/Penrose_tiling
 -------------------------------------------
i����(t*(tcostpi(tclocktsleepig�?ig@iii
cCsht|}td�t|�td�t|�td�t|�td�t|�td�dS(Ni$ili�(tftlttfdtrt(tltfl((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytkites








cCsht|}td�t|�td�t|�td�t|�td�t|�td�dS(Ni$i�(RRRR(R	R
((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytdart%s








cCs|dkrat�\}}tt��t|d�t|d�}}}tt|||f<dSt|}td�t||d�t	|�t
d�t||d�td�t	|t�t
d�t||d�td�t	|�t
d�t||d�td�dS(	Niii$ii�ii�i�(
tpostinttheadingtroundtTruettiledictRRtinflatedartRRtinflatekitetd(R	tntpxtpythtxtyR
((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyR1s(/








cCs�|dkrat�\}}tt��t|d�t|d�}}}tt|||f<dSt|}t||d�td�t	|�t
d�t||d�td�t	|t�t
d�t||d�t	|�t
d�dS(	Niiii$i�i6i~i�(
R
RRRtFalseRRRRRRRR(R	RRRRRRR
((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyRGs"/






cCs�t�|t|}t|d|d|�xvtD]n}|\}}}t||�t|�t|r�td�tdd�ntd�tdd�t�q4WdS(	NgY@Rtblackig�?R(ig�?i(g�?ii(	tclearRt	shapesizeRtsetpost
setheadingtshapetcolortstamp(R	RtthtkRRR((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytdrawZs






cCs2x+td�D]}t||�td�q
WdS(NiiH(trangeRR(R	Rti((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytsunjs
cCs2x+td�D]}t||�td�q
WdS(NiiH(R(RR(R	RR)((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytstaros
cCshtd�t�td�t�tdt��t�td�t�tdt��td�dS(NiidRRi(ttracert
begin_polyRtend_polytregister_shapetget_polyR(((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt
makeshapests


cCs*t�t�t�t�td�dS(Ntuser(tresetthttpuR1t
resizemode(((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytstart�s
i�iicCs�t|�td�iat�}td�|||�t�}t|||�td�t�}d||GHd||GHd||GHtgtD]}t|r�|^q��}	tgtD]}t|s�|^q��}
d|	|
|	|
fGHdS(NiisCalculation:   %7.4f ssDrawing:  %7.4f ssTogether: %7.4f ss"%d kites and %d darts = %d pieces.(tgotoR!RRR,R'tlen(R	RtfuntstartposR%tatbtcRtnktnd((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyttest�s 

	

	
	


))cCskt�x]td�D]O}t�}td||�t�}||}|dkrtd|�qqWdS(Nii,i(R7R(RRAR(R:R)R<R=tt((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytdemo�s		
cCs�td�tddd�tt�td�tt�td�tdd�tddd�td	d
ddd�t	dddd�dS(Ntlogog333333�?iiRi8���gffffff�?isPlease wait...taligntcentertfontsArial Blacki$tboldiXiR;iFiutDone(sArial Blacki$RH(iFiu(
tmodetbgcolorRCR*RR+tpencolorR8twriteRA(((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytmain�s





	
t__main__Ng��w�@gP�/7���?(ii(t__doc__tturtletmathRRttimeRRRRRRRRR'R*R+R1R7RARCRNt__name__tmsgtmainloop(((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt<module>s(

								
		PK�%�ZPX��''tdemo_minimal_hanoi.pycnu�[����
Afc@sdZddlTdefd��YZdefd��YZd�Zd�Zd	�Ze	d
kr{e�Z
e
GHe�ndS(s�       turtle-example-suite:

         tdemo_minimal_hanoi.py

A minimal 'Towers of Hanoi' animation:
A tower of 6 discs is transferred from the
left to the right peg.

An imho quite elegant and concise
implementation using a tower class, which
is derived from the built-in type list.

Discs are turtles with shape "square", but
stretched to rectangles by shapesize()
 ---------------------------------------
       To exit press STOP button
 ---------------------------------------
i����(t*tDisccBseZd�ZRS(cCsgtj|dddt�|j�|jd|dd�|j|ddd|d�|j�dS(	Ntshapetsquaretvisibleg�?ig@ii(tTurtlet__init__tFalsetput	shapesizet	fillcolortst(tselftn((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pyRs

(t__name__t
__module__R(((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pyRstTowercBs)eZdZd�Zd�Zd�ZRS(s-Hanoi tower, a subclass of built-in type listcCs
||_dS(s-create an empty tower. x is x-position of pegN(tx(RR((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pyR scCs<|j|j�|jddt|��|j|�dS(Nij���i"(tsetxRtsetytlentappend(Rtd((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pytpush#scCs tj|�}|jd�|S(Ni�(tlisttpopR(RR((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pyR's
(RRt__doc__RRR(((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pyRs		cCsT|dkrPt|d|||�|j|j��t|d|||�ndS(Nii(thanoiRR(R
tfrom_twith_tto_((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pyR,scCsYtdd�t�y-tdttt�tddddd
�Wntk
rTnXdS(Ntspaceispress STOP button to exittaligntcentertfonttCourieritbold(R#iR$(	tonkeytNonetclearRtt1tt2tt3twritet
Terminator(((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pytplay2s
	
cCs�t�t�tdd�td�atd�atd�ax-tddd�D]}tjt	|��qRWt
ddd	d
d�ttd�t
�dS(Nii���i���i�ii����spress spacebar to start gameR R!R"R#iR$Rt	EVENTLOOP(R#iR$(thttpenuptgotoRR(R)R*trangeRRR+R%R-tlisten(ti((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pytmain<s
	

t__main__N(RtturtleRRRRRR-R5Rtmsgtmainloop(((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pyt<module>s
		
		PK�%�ZJȤ��
turtle.cfgnu�[���width = 800
height = 600
canvwidth = 1200
canvheight = 900
shape = arrow
mode = standard
resizemode = auto
fillcolor = ""
title = Python turtle graphics demo.

PK�%�ZPX��''tdemo_minimal_hanoi.pyonu�[����
Afc@sdZddlTdefd��YZdefd��YZd�Zd�Zd	�Ze	d
kr{e�Z
e
GHe�ndS(s�       turtle-example-suite:

         tdemo_minimal_hanoi.py

A minimal 'Towers of Hanoi' animation:
A tower of 6 discs is transferred from the
left to the right peg.

An imho quite elegant and concise
implementation using a tower class, which
is derived from the built-in type list.

Discs are turtles with shape "square", but
stretched to rectangles by shapesize()
 ---------------------------------------
       To exit press STOP button
 ---------------------------------------
i����(t*tDisccBseZd�ZRS(cCsgtj|dddt�|j�|jd|dd�|j|ddd|d�|j�dS(	Ntshapetsquaretvisibleg�?ig@ii(tTurtlet__init__tFalsetput	shapesizet	fillcolortst(tselftn((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pyRs

(t__name__t
__module__R(((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pyRstTowercBs)eZdZd�Zd�Zd�ZRS(s-Hanoi tower, a subclass of built-in type listcCs
||_dS(s-create an empty tower. x is x-position of pegN(tx(RR((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pyR scCs<|j|j�|jddt|��|j|�dS(Nij���i"(tsetxRtsetytlentappend(Rtd((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pytpush#scCs tj|�}|jd�|S(Ni�(tlisttpopR(RR((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pyR's
(RRt__doc__RRR(((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pyRs		cCsT|dkrPt|d|||�|j|j��t|d|||�ndS(Nii(thanoiRR(R
tfrom_twith_tto_((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pyR,scCsYtdd�t�y-tdttt�tddddd
�Wntk
rTnXdS(Ntspaceispress STOP button to exittaligntcentertfonttCourieritbold(R#iR$(	tonkeytNonetclearRtt1tt2tt3twritet
Terminator(((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pytplay2s
	
cCs�t�t�tdd�td�atd�atd�ax-tddd�D]}tjt	|��qRWt
ddd	d
d�ttd�t
�dS(Nii���i���i�ii����spress spacebar to start gameR R!R"R#iR$Rt	EVENTLOOP(R#iR$(thttpenuptgotoRR(R)R*trangeRRR+R%R-tlisten(ti((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pytmain<s
	

t__main__N(RtturtleRRRRRR-R5Rtmsgtmainloop(((s7/usr/lib64/python2.7/Demo/turtle/tdemo_minimal_hanoi.pyt<module>s
		
		PK�%�ZUW�p��tdemo_planet_and_moon.pycnu�[����
Afc@s�dZddlmZmZmZmZddlmZdZ	de
fd��YZdefd��YZd	�Z
ed
kr�e
�e�ndS(s�       turtle-example-suite:

        tdemo_planets_and_moon.py

Gravitational system simulation using the
approximation method from Feynman-lectures,
p.9-8, using turtlegraphics.

Example: heavy central body, light planet,
very light moon!
Planet has a circular orbit, moon a stable
orbit around the planet.

You can hold the movement temporarily by
pressing the left mouse button with the
mouse over the scrollbar of the canvas.

i����(tShapetTurtletmainlooptVec2D(tsleepitGravSyscBs#eZd�Zd�Zd�ZRS(cCsg|_d|_d|_dS(Nig{�G�z�?(tplanetstttdt(tself((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyt__init__s		cCs"x|jD]}|j�q
WdS(N(Rtinit(R	tp((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyRscCsKxDtd�D]6}|j|j7_x|jD]}|j�q/Wq
WdS(Ni'(trangeRRRtstep(R	tiR((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pytstart!s(t__name__t
__module__R
RR(((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyRs		tStarcBs,eZd�Zd�Zd�Zd�ZRS(cCsptj|d|�|j�||_|j|�||_|jj|�||_|j	d�|j
�dS(Ntshapetuser(RR
tpenuptmtsetpostvRtappendtgravSyst
resizemodetpendown(R	RtxRRR((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyR
(s
	
		
cCs:|jj}|j�|_|jd||j|_dS(Ng�?(RRtacctaR(R	R((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyR2scCsrtdd�}x\|jjD]N}||kr|j�|j�}|t|jt|�d|7}qqW|S(Nii(tVecRRtpostGRtabs(R	R tplanetR((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyR6s*cCs�|jj}|j|j�||j�|jjj|�dkrh|j|j|jjd��n|j	�|_
|j||j
|_dS(Ni(RRRR"RRtindext
setheadingttowardsRR (R	R((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyR=s#(RRR
RRR(((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyR's	
		cCs�t�}|j�|jdd�|j�|j�|jd�|jd�|j�|jdd�|j	�|j
�}|j�|jdd�|j	�|j
�}td�}|j|d�|j|d�|j
�jd|�|jd	d�t�}td
tdd�tdd�|d�}|jd
�|jd�|j�tdtdd�tdd�|d�}|jd�|jd�td	tdd�tdd�|d�}|jd�|jd�|j�|j�dS(NiiiZi�tcompoundtorangetblueR%ii@Bg�tcircletyellowg������?i�0i�i�tgreeng�������?i�i'g�?sDone!(Rtresetttracerthttputfdtltt
begin_polyR,tend_polytget_polyRtaddcomponentt	getscreentregister_shapeRRR!tcolort	shapesizetpencolorRR(tstm1tm2tplanetshapetgstsuntearthtmoon((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pytmainGsD	








	*


*

*



t__main__N(t__doc__tturtleRRRRR!ttimeRR#tobjectRRRFR(((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyt<module>s" 	'PK�%�Z�::tdemo_colormixer.pynu�[���# colormixer

from turtle import Screen, Turtle, mainloop

class ColorTurtle(Turtle):

    def __init__(self, x, y):
        Turtle.__init__(self)
        self.shape("turtle")
        self.resizemode("user")
        self.shapesize(3,3,5)
        self.pensize(10)
        self._color = [0,0,0]
        self.x = x
        self._color[x] = y
        self.color(self._color)
        self.speed(0)
        self.left(90)
        self.pu()
        self.goto(x,0)
        self.pd()
        self.sety(1)
        self.pu()
        self.sety(y)
        self.pencolor("gray25")
        self.ondrag(self.shift)

    def shift(self, x, y):
        self.sety(max(0,min(y,1)))
        self._color[self.x] = self.ycor()
        self.fillcolor(self._color)
        setbgcolor()

def setbgcolor():
    screen.bgcolor(red.ycor(), green.ycor(), blue.ycor())

def main():
    global screen, red, green, blue
    screen = Screen()
    screen.delay(0)
    screen.setworldcoordinates(-1, -0.3, 3, 1.3)

    red = ColorTurtle(0, .5)
    green = ColorTurtle(1, .5)
    blue = ColorTurtle(2, .5)
    setbgcolor()

    writer = Turtle()
    writer.ht()
    writer.pu()
    writer.goto(1,1.15)
    writer.write("DRAG!",align="center",font=("Arial",30,("bold","italic")))
    return "EVENTLOOP"

if __name__ == "__main__":
    msg = main()
    print msg
    mainloop()
PK�%�ZM�krrtdemo_nim.pynu�[���"""      turtle-example-suite:

            tdemo_nim.py

Play nim against the computer. The player
who takes the last stick is the winner.

Implements the model-view-controller
design pattern.
"""


import turtle
import random
import time

SCREENWIDTH = 640
SCREENHEIGHT = 480

MINSTICKS = 7
MAXSTICKS = 31

HUNIT = SCREENHEIGHT // 12
WUNIT = SCREENWIDTH // ((MAXSTICKS // 5) * 11 + (MAXSTICKS % 5) * 2)

SCOLOR = (63, 63, 31)
HCOLOR = (255, 204, 204)
COLOR = (204, 204, 255)

def randomrow():
    return random.randint(MINSTICKS, MAXSTICKS)

def computerzug(state):
    xored = state[0] ^ state[1] ^ state[2]
    if xored == 0:
        return randommove(state)
    for z in range(3):
        s = state[z] ^ xored
        if s <= state[z]:
            move = (z, s)
            return move

def randommove(state):
    m = max(state)
    while True:
        z = random.randint(0,2)
        if state[z] > (m > 1):
            break
    rand = random.randint(m > 1, state[z]-1)
    return z, rand


class NimModel(object):
    def __init__(self, game):
        self.game = game

    def setup(self):
        if self.game.state not in [Nim.CREATED, Nim.OVER]:
            return
        self.sticks = [randomrow(), randomrow(), randomrow()]
        self.player = 0
        self.winner = None
        self.game.view.setup()
        self.game.state = Nim.RUNNING

    def move(self, row, col):
        maxspalte = self.sticks[row]
        self.sticks[row] = col
        self.game.view.notify_move(row, col, maxspalte, self.player)
        if self.game_over():
            self.game.state = Nim.OVER
            self.winner = self.player
            self.game.view.notify_over()
        elif self.player == 0:
            self.player = 1
            row, col = computerzug(self.sticks)
            self.move(row, col)
            self.player = 0

    def game_over(self):
        return self.sticks == [0, 0, 0]

    def notify_move(self, row, col):
        if self.sticks[row] <= col:
            return
        self.move(row, col)


class Stick(turtle.Turtle):
    def __init__(self, row, col, game):
        turtle.Turtle.__init__(self, visible=False)
        self.row = row
        self.col = col
        self.game = game
        x, y = self.coords(row, col)
        self.shape("square")
        self.shapesize(HUNIT/10.0, WUNIT/20.0)
        self.speed(0)
        self.pu()
        self.goto(x,y)
        self.color("white")
        self.showturtle()

    def coords(self, row, col):
        packet, remainder = divmod(col, 5)
        x = (3 + 11 * packet + 2 * remainder) * WUNIT
        y = (2 + 3 * row) * HUNIT
        return x - SCREENWIDTH // 2 + WUNIT // 2, SCREENHEIGHT // 2 - y - HUNIT // 2

    def makemove(self, x, y):
        if self.game.state != Nim.RUNNING:
            return
        self.game.controller.notify_move(self.row, self.col)


class NimView(object):
    def __init__(self, game):
        self.game = game
        self.screen = game.screen
        self.model = game.model
        self.screen.colormode(255)
        self.screen.tracer(False)
        self.screen.bgcolor((240, 240, 255))
        self.writer = turtle.Turtle(visible=False)
        self.writer.pu()
        self.writer.speed(0)
        self.sticks = {}
        for row in range(3):
            for col in range(MAXSTICKS):
                self.sticks[(row, col)] = Stick(row, col, game)
        self.display("... a moment please ...")
        self.screen.tracer(True)

    def display(self, msg1, msg2=None):
        self.screen.tracer(False)
        self.writer.clear()
        if msg2 is not None:
            self.writer.goto(0, - SCREENHEIGHT // 2 + 48)
            self.writer.pencolor("red")
            self.writer.write(msg2, align="center", font=("Courier",18,"bold"))
        self.writer.goto(0, - SCREENHEIGHT // 2 + 20)
        self.writer.pencolor("black")
        self.writer.write(msg1, align="center", font=("Courier",14,"bold"))
        self.screen.tracer(True)


    def setup(self):
        self.screen.tracer(False)
        for row in range(3):
            for col in range(self.model.sticks[row]):
                self.sticks[(row, col)].color(SCOLOR)
        for row in range(3):
            for col in range(self.model.sticks[row], MAXSTICKS):
                self.sticks[(row, col)].color("white")
        self.display("Your turn! Click leftmost stick to remove.")
        self.screen.tracer(True)

    def notify_move(self, row, col, maxspalte, player):
        if player == 0:
            farbe = HCOLOR
            for s in range(col, maxspalte):
                self.sticks[(row, s)].color(farbe)
        else:
            self.display(" ... thinking ...         ")
            time.sleep(0.5)
            self.display(" ... thinking ... aaah ...")
            farbe = COLOR
            for s in range(maxspalte-1, col-1, -1):
                time.sleep(0.2)
                self.sticks[(row, s)].color(farbe)
            self.display("Your turn! Click leftmost stick to remove.")

    def notify_over(self):
        if self.game.model.winner == 0:
            msg2 = "Congrats. You're the winner!!!"
        else:
            msg2 = "Sorry, the computer is the winner."
        self.display("To play again press space bar. To leave press ESC.", msg2)

    def clear(self):
        if self.game.state == Nim.OVER:
            self.screen.clear()


class NimController(object):

    def __init__(self, game):
        self.game = game
        self.sticks = game.view.sticks
        self.BUSY = False
        for stick in self.sticks.values():
            stick.onclick(stick.makemove)
        self.game.screen.onkey(self.game.model.setup, "space")
        self.game.screen.onkey(self.game.view.clear, "Escape")
        self.game.view.display("Press space bar to start game")
        self.game.screen.listen()

    def notify_move(self, row, col):
        if self.BUSY:
            return
        self.BUSY = True
        self.game.model.notify_move(row, col)
        self.BUSY = False

class Nim(object):
    CREATED = 0
    RUNNING = 1
    OVER = 2
    def __init__(self, screen):
        self.state = Nim.CREATED
        self.screen = screen
        self.model = NimModel(self)
        self.view = NimView(self)
        self.controller = NimController(self)


def main():
    mainscreen = turtle.Screen()
    mainscreen.mode("standard")
    mainscreen.setup(SCREENWIDTH, SCREENHEIGHT)
    nim = Nim(mainscreen)
    return "EVENTLOOP!"

if __name__ == "__main__":
    main()
    turtle.mainloop()
PK�%�Z�H�lltdemo_peace.pyonu�[����
Afc@s:dZddlTd�Zedkr6e�e�ndS(s�       turtle-example-suite:

              tdemo_peace.py

A simple drawing suitable as a beginner's
programming example. Aside from the
peacecolors assignment and the for loop,
it only uses turtle commands.
i����(t*cCsMd}t�t�t�tdd	�td
�xX|D]P}t|�t�td�t�td�t	d�td
�t
d�q9Wtd�td�tdd�t�td�t	d�td�t�t	d�td�t
d�t�td�t�td�t	d�t�td�t�tdd�dS(Ntred3torangetyellowt	seagreen4torchid4t
royalblue1tdodgerblue4i����i=���iFi�iZiBitwhiteiiV���i�iTi�i-i,sDone!(RRRRRRR(tresettScreentuptgototwidthtcolortdowntforwardtbackwardtlefttrighttcircle(tpeacecolorstpcolor((s//usr/lib64/python2.7/Demo/turtle/tdemo_peace.pytmainsL





















t__main__N(t__doc__tturtleRt__name__tmainloop(((s//usr/lib64/python2.7/Demo/turtle/tdemo_peace.pyt<module>
s

	-PK�%�Z�w�[��tdemo_wikipedia.pycnu�[����
��^c@srdZddlmZmZmZddlmZmZd�Zd�Z	e
dkrne	�ZeGHe�ndS(sF      turtle-example-suite:

          tdemo_wikipedia3.py

This example is
inspired by the Wikipedia article on turtle
graphics. (See example wikipedia1 for URLs)

First we create (ne-1) (i.e. 35 in this
example) copies of our first turtle p.
Then we let them perform their steps in
parallel.

Followed by a complete undo().
i����(tScreentTurtletmainloop(tclocktsleepcCs�|g}xGtd|�D]6}|j�}|jd|�|j|�|}qWxvt|�D]h}t|d|�|d}xC|D];}|jd|�|jd|d|�|j|�q�Wq`WdS(Nig�v@g@gffffff�?i(trangetclonetrttappendtabstpencolortfd(tptnetszt
turtlelisttitqtctt((s3/usr/lib64/python2.7/Demo/turtle/tdemo_wikipedia.pytmn_ecks	


cCst�}|jd�t�}|jd�|j�|jd�|jd�|jdd�t�}t	|dd�t�}||}t
d�t�}xPtg|j�D]}|j
�^q��r�x|j�D]}|j�q�Wq�Wt�}d|||S(	Ntblackitredii$iisLaufzeit: %.3f sec(RtbgcolorRtspeedt
hideturtleR
tpensizettracerRRRtanytturtlestundobufferentriestundo(tsRtattettz1R((s3/usr/lib64/python2.7/Demo/turtle/tdemo_wikipedia.pytmain$s&	
	



		

	.	t__main__N(t__doc__tturtleRRRttimeRRRR$t__name__tmsg(((s3/usr/lib64/python2.7/Demo/turtle/tdemo_wikipedia.pyt<module>s			PK�%�Z�H�lltdemo_peace.pycnu�[����
Afc@s:dZddlTd�Zedkr6e�e�ndS(s�       turtle-example-suite:

              tdemo_peace.py

A simple drawing suitable as a beginner's
programming example. Aside from the
peacecolors assignment and the for loop,
it only uses turtle commands.
i����(t*cCsMd}t�t�t�tdd	�td
�xX|D]P}t|�t�td�t�td�t	d�td
�t
d�q9Wtd�td�tdd�t�td�t	d�td�t�t	d�td�t
d�t�td�t�td�t	d�t�td�t�tdd�dS(Ntred3torangetyellowt	seagreen4torchid4t
royalblue1tdodgerblue4i����i=���iFi�iZiBitwhiteiiV���i�iTi�i-i,sDone!(RRRRRRR(tresettScreentuptgototwidthtcolortdowntforwardtbackwardtlefttrighttcircle(tpeacecolorstpcolor((s//usr/lib64/python2.7/Demo/turtle/tdemo_peace.pytmainsL





















t__main__N(t__doc__tturtleRt__name__tmainloop(((s//usr/lib64/python2.7/Demo/turtle/tdemo_peace.pyt<module>
s

	-PK�%�Ztn*ܷ�tdemo_chaos.pynu�[���# File: tdemo_chaos.py
# Author: Gregor Lingl
# Date: 2009-06-24

# A demonstration of chaos

from turtle import *

N = 80

def f(x):
    return 3.9*x*(1-x)

def g(x):
    return 3.9*(x-x**2)

def h(x):
    return 3.9*x-3.9*x*x

def jumpto(x, y):
    penup(); goto(x,y)

def line(x1, y1, x2, y2):
    jumpto(x1, y1)
    pendown()
    goto(x2, y2)

def coosys():
    line(-1, 0, N+1, 0)
    line(0, -0.1, 0, 1.1)

def plot(fun, start, color):
    pencolor(color)
    x = start
    jumpto(0, x)
    pendown()
    dot(5)
    for i in range(N):
        x=fun(x)
        goto(i+1,x)
        dot(5)

def main():
    reset()
    setworldcoordinates(-1.0,-0.1, N+1, 1.1)
    speed(0)
    hideturtle()
    coosys()
    plot(f, 0.35, "blue")
    plot(g, 0.35, "green")
    plot(h, 0.35, "red")
    # Now zoom in:
    for s in range(100):
        setworldcoordinates(0.5*s,-0.1, N+1, 1.1)
    return "Done!"

if __name__ == "__main__":
    main()
    mainloop()
PK�%�Z:�B�mmtdemo_paint.pyonu�[����
Afc@s_dZddlTddd�Zddd�Zd�Zedkr[e�ZeGHe�ndS(	sp       turtle-example-suite:

            tdemo_paint.py

A simple  event-driven paint program

- left mouse button moves turtle
- middle mouse button changes color
- right mouse button toogles betweem pen up
(no line drawn when the turtle moves) and
pen down (line is drawn). If pen up follows
at least two pen-down moves, the polygon that
includes the starting point is filled.
 -------------------------------------------
 Play around by clicking into the canvas
 using all three mouse buttons.
 -------------------------------------------
          To exit press STOP button
 -------------------------------------------
i����(t*icCs0t�drt�t�nt�t�dS(Ntpendown(tpentend_filltuptdownt
begin_fill(txty((s//usr/lib64/python2.7/Demo/turtle/tdemo_paint.pytswitchupdowns


cCs$tdtd attd�dS(Nii(tcolorstcolor(RR((s//usr/lib64/python2.7/Demo/turtle/tdemo_paint.pytchangecolor scCsztd�td�td�td�ddddgattd	�t�ttd
�tt	d�ttd�dS(
Ntcircletuserg�?itredtgreentbluetyellowiiit	EVENTLOOP(
tshapet
resizemodet	shapesizetwidthR
RR	t
onscreenclicktgotoR(((s//usr/lib64/python2.7/Demo/turtle/tdemo_paint.pytmain%s






t__main__N(t__doc__tturtleR	RRt__name__tmsgtmainloop(((s//usr/lib64/python2.7/Demo/turtle/tdemo_paint.pyt<module>s
		PK�%�Z��j%))tdemo_peace.pynuȯ��#! /usr/bin/python2.7
"""       turtle-example-suite:

              tdemo_peace.py

A simple drawing suitable as a beginner's
programming example. Aside from the
peacecolors assignment and the for loop,
it only uses turtle commands.
"""

from turtle import *

def main():
    peacecolors = ("red3",  "orange", "yellow",
                   "seagreen4", "orchid4",
                   "royalblue1", "dodgerblue4")

    reset()
    Screen()
    up()
    goto(-320,-195)
    width(70)

    for pcolor in peacecolors:
        color(pcolor)
        down()
        forward(640)
        up()
        backward(640)
        left(90)
        forward(66)
        right(90)

    width(25)
    color("white")
    goto(0,-170)
    down()

    circle(170)
    left(90)
    forward(340)
    up()
    left(180)
    forward(170)
    right(45)
    down()
    forward(170)
    up()
    backward(170)
    left(90)
    down()
    forward(170)
    up()

    goto(0,300) # vanish if hideturtle() is not available ;-)
    return "Done!"

if __name__ == "__main__":
    main()
    mainloop()
PK�%�Z^��tdemo_chaos.pyonu�[����
��^c@syddlTdZd�Zd�Zd�Zd�Zd�Zd�Zd	�Zd
�Z	e
dkrue	�e�ndS(
i����(t*iPcCsd|d|S(Ng333333@i((tx((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pytfscCsd||dS(Ng333333@i((R((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pytgscCsd|d||S(Ng333333@((R((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pythscCst�t||�dS(N(tpenuptgoto(Rty((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pytjumptoscCs%t||�t�t||�dS(N(RtpendownR(tx1ty1tx2ty2((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pytlines
cCs.tddtdd�tdddd�dS(Ni����iig��������g�������?(RtN(((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pytcoosysscCspt|�|}td|�t�td�x;tt�D]-}||�}t|d|�td�q;WdS(Niii(tpencolorRR	tdottrangeRR(tfuntstarttcolorRti((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pytplot s


cCs�t�tddtdd�td�t�t�ttdd�ttdd�tt	dd	�x/t
d
�D]!}td|dtdd�qsWdS(
Ng�g��������ig�������?igffffff�?tbluetgreentredidg�?sDone!(tresettsetworldcoordinatesRtspeedt
hideturtleRRRRRR(ts((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pytmain+s
t__main__N(tturtleRRRRRRRRR!t__name__tmainloop(((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pyt<module>s
								PK�%�Z������tdemo_clock.pynuȯ��#! /usr/bin/python2.7
# -*- coding: cp1252 -*-
"""       turtle-example-suite:

             tdemo_clock.py

Enhanced clock-program, showing date
and time
  ------------------------------------
   Press STOP to exit the program!
  ------------------------------------
"""
from turtle import *
from datetime import datetime

def jump(distanz, winkel=0):
    penup()
    right(winkel)
    forward(distanz)
    left(winkel)
    pendown()

def hand(laenge, spitze):
    fd(laenge*1.15)
    rt(90)
    fd(spitze/2.0)
    lt(120)
    fd(spitze)
    lt(120)
    fd(spitze)
    lt(120)
    fd(spitze/2.0)

def make_hand_shape(name, laenge, spitze):
    reset()
    jump(-laenge*0.15)
    begin_poly()
    hand(laenge, spitze)
    end_poly()
    hand_form = get_poly()
    register_shape(name, hand_form)

def clockface(radius):
    reset()
    pensize(7)
    for i in range(60):
        jump(radius)
        if i % 5 == 0:
            fd(25)
            jump(-radius-25)
        else:
            dot(3)
            jump(-radius)
        rt(6)

def setup():
    global second_hand, minute_hand, hour_hand, writer
    mode("logo")
    make_hand_shape("second_hand", 125, 25)
    make_hand_shape("minute_hand",  130, 25)
    make_hand_shape("hour_hand", 90, 25)
    clockface(160)
    second_hand = Turtle()
    second_hand.shape("second_hand")
    second_hand.color("gray20", "gray80")
    minute_hand = Turtle()
    minute_hand.shape("minute_hand")
    minute_hand.color("blue1", "red1")
    hour_hand = Turtle()
    hour_hand.shape("hour_hand")
    hour_hand.color("blue3", "red3")
    for hand in second_hand, minute_hand, hour_hand:
        hand.resizemode("user")
        hand.shapesize(1, 1, 3)
        hand.speed(0)
    ht()
    writer = Turtle()
    #writer.mode("logo")
    writer.ht()
    writer.pu()
    writer.bk(85)

def wochentag(t):
    wochentag = ["Monday", "Tuesday", "Wednesday",
        "Thursday", "Friday", "Saturday", "Sunday"]
    return wochentag[t.weekday()]

def datum(z):
    monat = ["Jan.", "Feb.", "Mar.", "Apr.", "May", "June",
             "July", "Aug.", "Sep.", "Oct.", "Nov.", "Dec."]
    j = z.year
    m = monat[z.month - 1]
    t = z.day
    return "%s %d %d" % (m, t, j)

def tick():
    t = datetime.today()
    sekunde = t.second + t.microsecond*0.000001
    minute = t.minute + sekunde/60.0
    stunde = t.hour + minute/60.0
    try:
        tracer(False)  # Terminator can occur here
        writer.clear()
        writer.home()
        writer.forward(65)
        writer.write(wochentag(t),
                     align="center", font=("Courier", 14, "bold"))
        writer.back(150)
        writer.write(datum(t),
                     align="center", font=("Courier", 14, "bold"))
        writer.forward(85)
        tracer(True)
        second_hand.setheading(6*sekunde)  # or here
        minute_hand.setheading(6*minute)
        hour_hand.setheading(30*stunde)
        tracer(True)
        ontimer(tick, 100)
    except Terminator:
        pass  # turtledemo user pressed STOP

def main():
    tracer(False)
    setup()
    tracer(True)
    tick()
    return "EVENTLOOP"

if __name__ == "__main__":
    mode("logo")
    msg = main()
    print msg
    mainloop()  # keep window open
PK�%�Zp||tdemo_I_dontlike_tiltdemo.pycnu�[����
Afc@sMdZddlTddlZd�ZedkrIe�ZeGHe�ndS(s       turtle-example-suite:

     tdemo-I_dont_like_tiltdemo.py

Demonstrates
  (a) use of a tilted ellipse as
      turtle shape
  (b) stamping that shape

We can remove it, if you don't like it.
      Without using reset() ;-)
 ---------------------------------------
i����(t*NcCs�t�td�td�t�tdd�td�t�td�t�tdd	d
�t	dd�x/t
d�D]!}td�td
�t
�q|Wt	dd�x/t
d�D]!}td�td
�t
�q�Wtd�tddd�t	dd�xBt
d�D]4}td�td
�|ddkrt
�qqWtjd�xt�rot�q\Wt�tddddd �dS(!Ntcircletuseriigo���!@iZi-ii
itredtvioletiti�iiitbluetyellowiiis	OK, OVER!taligntcentertfonttCouriertboldsDone!i�(RiR(tresettshapet
resizemodetputbktrttpdttiltt
turtlesizetcolortrangetfdtlttstampttimetsleeptundobufferentriestundothttwrite(ti((s=/usr/lib64/python2.7/Demo/turtle/tdemo_I_dontlike_tiltdemo.pytmainsD














t__main__(t__doc__tturtleRR"t__name__tmsgtmainloop(((s=/usr/lib64/python2.7/Demo/turtle/tdemo_I_dontlike_tiltdemo.pyt<module>s
	%	PK�%�ZUW�p��tdemo_planet_and_moon.pyonu�[����
Afc@s�dZddlmZmZmZmZddlmZdZ	de
fd��YZdefd��YZd	�Z
ed
kr�e
�e�ndS(s�       turtle-example-suite:

        tdemo_planets_and_moon.py

Gravitational system simulation using the
approximation method from Feynman-lectures,
p.9-8, using turtlegraphics.

Example: heavy central body, light planet,
very light moon!
Planet has a circular orbit, moon a stable
orbit around the planet.

You can hold the movement temporarily by
pressing the left mouse button with the
mouse over the scrollbar of the canvas.

i����(tShapetTurtletmainlooptVec2D(tsleepitGravSyscBs#eZd�Zd�Zd�ZRS(cCsg|_d|_d|_dS(Nig{�G�z�?(tplanetstttdt(tself((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyt__init__s		cCs"x|jD]}|j�q
WdS(N(Rtinit(R	tp((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyRscCsKxDtd�D]6}|j|j7_x|jD]}|j�q/Wq
WdS(Ni'(trangeRRRtstep(R	tiR((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pytstart!s(t__name__t
__module__R
RR(((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyRs		tStarcBs,eZd�Zd�Zd�Zd�ZRS(cCsptj|d|�|j�||_|j|�||_|jj|�||_|j	d�|j
�dS(Ntshapetuser(RR
tpenuptmtsetpostvRtappendtgravSyst
resizemodetpendown(R	RtxRRR((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyR
(s
	
		
cCs:|jj}|j�|_|jd||j|_dS(Ng�?(RRtacctaR(R	R((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyR2scCsrtdd�}x\|jjD]N}||kr|j�|j�}|t|jt|�d|7}qqW|S(Nii(tVecRRtpostGRtabs(R	R tplanetR((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyR6s*cCs�|jj}|j|j�||j�|jjj|�dkrh|j|j|jjd��n|j	�|_
|j||j
|_dS(Ni(RRRR"RRtindext
setheadingttowardsRR (R	R((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyR=s#(RRR
RRR(((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyR's	
		cCs�t�}|j�|jdd�|j�|j�|jd�|jd�|j�|jdd�|j	�|j
�}|j�|jdd�|j	�|j
�}td�}|j|d�|j|d�|j
�jd|�|jd	d�t�}td
tdd�tdd�|d�}|jd
�|jd�|j�tdtdd�tdd�|d�}|jd�|jd�td	tdd�tdd�|d�}|jd�|jd�|j�|j�dS(NiiiZi�tcompoundtorangetblueR%ii@Bg�tcircletyellowg������?i�0i�i�tgreeng�������?i�i'g�?sDone!(Rtresetttracerthttputfdtltt
begin_polyR,tend_polytget_polyRtaddcomponentt	getscreentregister_shapeRRR!tcolort	shapesizetpencolorRR(tstm1tm2tplanetshapetgstsuntearthtmoon((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pytmainGsD	








	*


*

*



t__main__N(t__doc__tturtleRRRRR!ttimeRR#tobjectRRRFR(((s9/usr/lib64/python2.7/Demo/turtle/tdemo_planet_and_moon.pyt<module>s" 	'PK�%�Z8Hw�*�*turtleDemo.pyonu�[����
Afc@s0ddlZddlZddlTddlmZddlmZddlmZddl	Z	ddl
Z
ej�Zdej
e�kr�dGHdGeGHej�nd	Zd
ZdZdZd
ZddefZdZd Zd�Zd!d"d#fZdefd��YZd�Zedkr,e�ndS($i����N(t*(t
Percolator(tColorDelegator(t	view_files
turtleDemo.pys:Directory of turtleDemo must be current working directory!sBut in your case this isiiiiitArialitboldsLucida ConsoleitnormalcCs�gtjt�D]+}|jd�r|jd�r|^q}g}x�|D]�}|jd�rs|j|�qNtjjt|�}tjj|�|g}gtj|�D]*}|jd�r�|jd�r�|^q�}|j||�qNW|S(Nttdemo_s.pycs.py(	tostlistdirtdemo_dirt
startswithtendswithtappendtpathtjointsys(tentrytentries1tentries2Rtsubdirtscripttscripts((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pytgetExampleEntriess
	sTurtledemo helpsdemohelp.txtsAbout turtledemosabout_turtledemo.txtsAbout turtle modulesabout_turtle.txtt
DemoWindowcBs�eZdd�Zd�Zd�Zd�Zddd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�ZRS(cCst�|_}t_|jd�|jd|j�|jddd�|jddd�|jddddd�|jddddd�|jd	dddd�t	|d
t
dd�|_|j�|_
|j�|_|jjddd
ddd�tdtdddtdd�}|j|j|��|j|j|��|jddd
ddd�t|dddddddd,ddd
t�|_t|dddtd d!d"d#d$|j�|_t|dd%dtd d!d"d#d$|j�|_t|dd&dtd d!d"d#d$|j �|_!|jjddd'dddd(d-�|jjddd'ddd)�|jjddd'ddd)�|j!jddd'd	dd)�t"|j#�j$t%��t&|_'t&|_(|r�|j)|�n|j*t+t,t,t,d*d+�t-|_.dS(.NsPython turtle-graphics examplestWM_DELETE_WINDOWitweightitminsizeiZiitrelieftborderwidthtrowt
columnspanitstickytnewstorientt	sashwidthit
sashrelieftbgs#dddtheightttexts --- s#ddftfontRiRs START tfgtwhitetdisabledforegrounds#fedtcommands STOP s CLEAR tcolumntpadxtewsChoose example from menutblack(RiR(ii(/tTktroottturtlet_rootttitletwm_protocolt_destroytgrid_rowconfiguretgrid_columnconfiguretFrametRAISEDtmBartmakeLoadDemoMenutExamplesBtntmakeHelpMenut
OptionsBtntgridtPanedWindowt
HORIZONTALtSOLIDtaddt
makeTextFrametmakeGraphFrametLabeltRIDGEt
output_lbltButtontbtnfontt	startDemot	start_btntstopIttstop_btntclearCanvast	clear_btnRR'tinsertfilterRtFalsetdirtytexitflagtloadfilet	configGUItNORMALtDISABLEDtSTARTUPtstate(tselftfilenameR2tpane((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyt__init__7sR
%		
cCsf|jj�}|jj�}|jjd|j||j�|jjd|j||j�dS(Ng�?(t_canvastwinfo_widthtwinfo_heighttxview_movetot	canvwidthtyview_movetot
canvheight(R]teventtcwidthtcheight((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pytonResizehs"c
Cst|�|_}t|dddddddd�|_}t|dd	�|_}|j|d
<|jdtdt	�t|dd
dt
�|_}|j|d
<|jdt
dt�t|d<|j|d<|j|d<|jdtdtdd�|S(NtnameR'R.itwraptnonetwidthi-tvbarR,tsidetfillthbarR"R(tyscrollcommandtxscrollcommandtexpandi(R:t
text_frametTextR't	ScrollbarRptyviewtpacktLEFTtYRCRstxviewtBOTTOMtXttxtfonttsettBOTH(R]R2RwR'RpRs((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyRFns




cCs�|tj_d|_d|_tj|dd|j|j�tj_|_}|j�|jj	d|j
�d|jd<tj�|_}tj
j||j�|j|_|gtj_|S(Ni�i iXs<Configure>iR(R3t_ScreenR4ReRgtScrolledCanvasRat
adjustScrollst_rootwindowtbindRktScreentscreentTurtleScreenR`tscanvast	RawTurtletscreens(R]R2tcanvast_s_((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyRG�s		,

ttbluecCs�|jjd|�|jjd|d|tkr7dnd�|jjd|d|tkrbdnd�|jjd|d|tkr�dnd�|jjd|d|�dS(NR\R%s#d00s#fcaR'R)(R>tconfigRNRYRPRRRJ(R]tmenutstarttstoptclearttxttcolor((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyRX�scsft�jdddddt�}|jdtdd�t|�|_xt�D]}�fd	�}t|t	�r�|jj
d
|dd!dddtd
||��qP|d|d}}t|j�|j_xR|D]J}|jjj
d
|dd!dddtd
|tj
j||���q�W|jjd
|dd|jjdt�qPW|j|d<|S(NR'tExamplest	underlineiR(RqR.t2mcs��fd�}|S(Ncs�j��dS(N(RW((R]tx(s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pytemit�s((R�R�(R](R�s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pytloadexample�stlabelii����R,iR�(t
MenubuttonR<tmenufontR{R|tMenuR�Rt
isinstancetstrtadd_commandtchoicesRRRtadd_cascade(R]tCmdBtnRR�t_dirtentrieste((R]s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyR=�s(
 !
cs�t�jdddddt�}|jdtdd�t|�|_xHtD]@\}}||�fd	�}|jjd
|dtd|�qMW|j|d<|S(
NR'tHelpR�iR(RqR.R�cs&t�j|tjjt|��dS(N(RR2RRRR
(t
help_labelt	help_file(R](s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pytshow�sR�R,R�(	R�R<R�R{R|R�R�thelp_entriesR�(R]R�R�R�R�((R]s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyR?�s!#
cCs'|js
dS|jj�t|_dS(N(RUR�R�RT(R]((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyt
refreshCanvas�s	
cCs�|j�tjj|�r�tjj|�r�t|d�}|j�}|j�|jj	dd�|jj
d|�tjj|�\}}|jj
|dd!d�t|d �|_|jttttdd�t|_ndS(	Ntrs1.0tendii����s# - a Python turtle graphics examplesPress start buttontred(R�RRtexiststisdirtopentreadtcloseR'tdeletetinserttsplitR2R5t
__import__tmoduleRXRYRZtREADYR\(R]R^tftcharstdirectfname((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyRW�s
%

cCs4|j�t|_ttj_|jttttdd�|j	j
�|j	jd�t|_
y4|jj�}|dkr�t|_
n	t|_
Wn6tjk
r�|jdkr�dSt|_
d}nX|j
tkr�|jtttt|�n7|j
tkr0t|_|jttttdd�ndS(Nsdemo running...R0tstandardt	EVENTLOOPsstopped!suse mouse/keys or STOPR�(R�tTrueRUR3R�t_RUNNINGRXRZRYR�R�tmodetRUNNINGR\R�tmaintEVENTDRIVENtDONEt
TerminatorR2tNoneRV(R]tresult((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyRM�s2
	

	
	

	cCs7|j�|jjdd�|jtttt�dS(NtcursorR�(R�R�R�RXRYRZ(R]((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyRQ�s
cCsW|jrG|j�t|_|jttttdd�ttj_nttj_dS(NsSTOPPED!R�(	RVRQRTRXRYRZR3R�R�(R]((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyRO�s	
	
cCs&ttj_|jj�d|_dS(N(RTR3R�R�R2tdestroyR�(R]((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyR7s
N(t__name__t
__module__R�R`RkRFRGRXR=R?R�RWRMRQROR7(((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyR5s1					
					
cCst�}|jj�dS(N(RR2tmainloop(tdemo((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyR�s	t__main__(RiR(sLucida ConsoleiR(sTurtledemo helpsdemohelp.txt(sAbout turtledemosabout_turtledemo.txt(sAbout turtle modulesabout_turtle.txt(RRtTkintertidlelib.PercolatorRtidlelib.ColorDelegatorRtidlelib.textViewRR3ttimetgetcwdR
R	texitR[R�R�R�R�RYR�RLR�RR�tobjectRR�R�(((s./usr/lib64/python2.7/Demo/turtle/turtleDemo.pyt<module>s8
	
		�	PK�%�Z�F\���tdemo_bytedesign.pyonu�[����
Afc@sdZddlZddlmZmZddlmZdefd��YZd�Ze	dkr{e�Z
e
GHe�ndS(	s�      turtle-example-suite:

        tdemo_bytedesign.py

An example adapted from the example-suite
of PythonCard's turtle graphcis.

It's based on an article in BYTE magazine
Problem Solving with Logo: Using Turtle
Graphics to Redraw a Design
November 1982, p. 118 - 134

-------------------------------------------

Due to the statement

t.delay(0)

in line 152, which sets the animation delay
to 0, this animation runs in "line per line"
mode as fast as possible.
i����N(tTurtletmainloop(tclocktDesignercBsYeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	cCs�|j�xmtd�D]_}|jd|�|j�|j|j�|�|j�|jd|�|jd�qW|j�|j|�|jd�|jd|�|jd�|j�|j	d|d|�|j
t�dS(	Nig�����)P@iHi$g�8@i�i.g������a@(tuptrangetforwardtdowntwheeltpositiontbackwardtrighttgototcenterpiecettracertTrue(tselfthomePostscaleti((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pytdesign!s 







cCs�|jd�x$td�D]}|j||�qW|j�|jd�x$td�D]}|j||�qXW|jd�xWtd�D]I}|j�|jd�|jd|�|j�|jd|�q�W|jd�|j	�j
�dS(Ni6ii$iiHi(RRt	pentpieceRtleftttripieceRRR
t	getscreentupdate(RtinitposRR((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR3s 







cCs�|j�}|j�|jd|�|jd||�|j�|j|�|j|�|j�|jd|�|jd||�|j�|j|�|j|�|jd�|j	�j
�dS(Ng@g�?@iH(theadingRR
ttripolyrRRt
setheadingttripolylRRR(RRRtoldh((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyREs








cCsM|j�}|j�|jd|�|j�x2td�D]$}|jd|�|jd�q>W|jd|d|�|j�|j|�|j|�|jd|�|j�x2td�D]$}|jd|�|jd�q�W|j	d|d|�|j�|j|�|j|�|j
d�|j�j�dS(NiiiiHiK(
RRRRRRtpentrRRtpentlRRR(RRRRR((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyRVs,









cCsM|d|krdS|j|�|j|�|j|d|||�dS(NigR���Q�?(RRR!(RtsidetangR((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR!ns


cCsM|d|krdS|j|�|j|�|j|d|||�dS(NigR���Q�?(RRR (RR"R#R((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR ts


cCs�|d|krdS|j|�|jd�|j|d�|jd�|j|d�|jd�|j|d|�dS(Niiog{�G�z�?g�������?i�g�?(RRR(RR"R((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyRzs



cCs�|d|krdS|j|�|jd�|j|d�|jd�|j|d�|jd�|j|d|�dS(Niiog{�G�z�?g�������?i�g�?(RRR(RR"R((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR�s



cCsM|j|�|j|�|d|kr.dS|j|d|||�dS(Ng@g333333�?(RRR
(RtstaR((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR
�s


(t__name__t
__module__RRRRR!R RRR
(((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyRs							
	
cCstt�}|jd�|j�|j�jd�|jd�t�}|j|j�d�t�}d||S(Niisruntime: %.2f sec.(	Rtspeedt
hideturtleRtdelayRRRR	(tttattet((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pytmain�s	


		t__main__(t__doc__tmathtturtleRRttimeRRR.R&tmsg(((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyt<module>su		PK�%�Z�3'vuutdemo_penrose.pycnu�[����
Afc@sdZddlTddlmZmZddlmZmZddZd	ed
ed�Z	d�Z
d
�Zd�Zd�Z
d	d�Zd�Zd�Zd�Zd�Zddedd	d�Zed�Zd�Zedkr�e�Ze�ndS( s�       xturtle-example-suite:

          xtx_kites_and_darts.py

Constructs two aperiodic penrose-tilings,
consisting of kites and darts, by the method
of inflation in six steps.

Starting points are the patterns "sun"
consisting of five kites and "star"
consisting of five darts.

For more information see:
 http://en.wikipedia.org/wiki/Penrose_tiling
 -------------------------------------------
i����(t*(tcostpi(tclocktsleepig�?ig@iii
cCsht|}td�t|�td�t|�td�t|�td�t|�td�dS(Ni$ili�(tftlttfdtrt(tltfl((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytkites








cCsht|}td�t|�td�t|�td�t|�td�t|�td�dS(Ni$i�(RRRR(R	R
((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytdart%s








cCs|dkrat�\}}tt��t|d�t|d�}}}tt|||f<dSt|}td�t||d�t	|�t
d�t||d�td�t	|t�t
d�t||d�td�t	|�t
d�t||d�td�dS(	Niii$ii�ii�i�(
tpostinttheadingtroundtTruettiledictRRtinflatedartRRtinflatekitetd(R	tntpxtpythtxtyR
((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyR1s(/








cCs�|dkrat�\}}tt��t|d�t|d�}}}tt|||f<dSt|}t||d�td�t	|�t
d�t||d�td�t	|t�t
d�t||d�t	|�t
d�dS(	Niiii$i�i6i~i�(
R
RRRtFalseRRRRRRRR(R	RRRRRRR
((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyRGs"/






cCs�t�|t|}t|d|d|�xvtD]n}|\}}}t||�t|�t|r�td�tdd�ntd�tdd�t�q4WdS(	NgY@Rtblackig�?R(ig�?i(g�?ii(	tclearRt	shapesizeRtsetpost
setheadingtshapetcolortstamp(R	RtthtkRRR((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytdrawZs






cCs2x+td�D]}t||�td�q
WdS(NiiH(trangeRR(R	Rti((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytsunjs
cCs2x+td�D]}t||�td�q
WdS(NiiH(R(RR(R	RR)((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytstaros
cCshtd�t�td�t�tdt��t�td�t�tdt��td�dS(NiidRRi(ttracert
begin_polyRtend_polytregister_shapetget_polyR(((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt
makeshapests


cCs*t�t�t�t�td�dS(Ntuser(tresetthttpuR1t
resizemode(((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytstart�s
i�iicCs�t|�td�iat�}td�|||�t�}t|||�td�t�}d||GHd||GHd||GHtgtD]}t|r�|^q��}	tgtD]}t|s�|^q��}
d|	|
|	|
fGHdS(NiisCalculation:   %7.4f ssDrawing:  %7.4f ssTogether: %7.4f ss"%d kites and %d darts = %d pieces.(tgotoR!RRR,R'tlen(R	RtfuntstartposR%tatbtcRtnktnd((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyttest�s 

	

	
	


))cCskt�x]td�D]O}t�}td||�t�}||}|dkrtd|�qqWdS(Nii,i(R7R(RRAR(R:R)R<R=tt((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytdemo�s		
cCs�td�tddd�tt�td�tt�td�tdd�tddd�td	d
ddd�t	dddd�dS(Ntlogog333333�?iiRi8���gffffff�?isPlease wait...taligntcentertfontsArial Blacki$tboldiXiR;iFiutDone(sArial Blacki$RH(iFiu(
tmodetbgcolorRCR*RR+tpencolorR8twriteRA(((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pytmain�s





	
t__main__Ng��w�@gP�/7���?(ii(t__doc__tturtletmathRRttimeRRRRRRRRR'R*R+R1R7RARCRNt__name__tmsgtmainloop(((s1/usr/lib64/python2.7/Demo/turtle/tdemo_penrose.pyt<module>s(

								
		PK�%�Zu��Ucctdemo_two_canvases.pyonu�[����
��^c@sOdZddlmZmZmZd�ZedkrKe�ej�ndS(s�turtledemo.two_canvases

Use TurtleScreen and RawTurtle to draw on two
distinct canvases in a separate windows. The
new window must be separately closed in
addition to pressing the STOP button.
i����(tTurtleScreent	RawTurtletTKc	Cs�tj�}tj|dddddd�}tj|dddddd�}|j�|j�t|�}|jddd	�t|�}|jd	dd�t|�}t|�}|jd
d�|jd�|jdd�|jd�x.||fD] }|j	d
�|j
d�q�W|j
d�x||fD]}|j�q=WxEtd�D]7}x.||fD] }|j
d�|j
d�qqWq^WxB||fD]4}|j�|j
d�|j�|jd�q�WdS(Ntwidthi,theighti�tbgs#ddffffs#ffeeeeg333333�?itreditbluetturtlei$i�ii2iHi6t	EVENTLOOP(ig333333�?g333333�?(g333333�?g333333�?i(RtTktCanvastpackRtbgcolorRtcolorRtshapetltt
begin_filltrangetfdtend_filltputbk(	troottcv1tcv2ts1ts2tptqttti((s6/usr/lib64/python2.7/Demo/turtle/tdemo_two_canvases.pytmains>!!









t__main__N(t__doc__RRRRR t__name__tmainloop(((s6/usr/lib64/python2.7/Demo/turtle/tdemo_two_canvases.pyt<module>s
	)PK�%�ZH}�``tdemo_two_canvases.pynu�[���"""turtledemo.two_canvases

Use TurtleScreen and RawTurtle to draw on two
distinct canvases in a separate windows. The
new window must be separately closed in
addition to pressing the STOP button.
"""

from turtle import TurtleScreen, RawTurtle, TK

def main():
    root = TK.Tk()
    cv1 = TK.Canvas(root, width=300, height=200, bg="#ddffff")
    cv2 = TK.Canvas(root, width=300, height=200, bg="#ffeeee")
    cv1.pack()
    cv2.pack()

    s1 = TurtleScreen(cv1)
    s1.bgcolor(0.85, 0.85, 1)
    s2 = TurtleScreen(cv2)
    s2.bgcolor(1, 0.85, 0.85)

    p = RawTurtle(s1)
    q = RawTurtle(s2)

    p.color("red", (1, 0.85, 0.85))
    p.width(3)
    q.color("blue", (0.85, 0.85, 1))
    q.width(3)

    for t in p,q:
        t.shape("turtle")
        t.lt(36)

    q.lt(180)

    for t in p, q:
        t.begin_fill()
    for i in range(5):
        for t in p, q:
            t.fd(50)
            t.lt(72)
    for t in p,q:
        t.end_fill()
        t.lt(54)
        t.pu()
        t.bk(50)

    return "EVENTLOOP"


if __name__ == '__main__':
    main()
    TK.mainloop()  # keep window open until user closes it
PK�%�Z�F\���tdemo_bytedesign.pycnu�[����
Afc@sdZddlZddlmZmZddlmZdefd��YZd�Ze	dkr{e�Z
e
GHe�ndS(	s�      turtle-example-suite:

        tdemo_bytedesign.py

An example adapted from the example-suite
of PythonCard's turtle graphcis.

It's based on an article in BYTE magazine
Problem Solving with Logo: Using Turtle
Graphics to Redraw a Design
November 1982, p. 118 - 134

-------------------------------------------

Due to the statement

t.delay(0)

in line 152, which sets the animation delay
to 0, this animation runs in "line per line"
mode as fast as possible.
i����N(tTurtletmainloop(tclocktDesignercBsYeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	cCs�|j�xmtd�D]_}|jd|�|j�|j|j�|�|j�|jd|�|jd�qW|j�|j|�|jd�|jd|�|jd�|j�|j	d|d|�|j
t�dS(	Nig�����)P@iHi$g�8@i�i.g������a@(tuptrangetforwardtdowntwheeltpositiontbackwardtrighttgototcenterpiecettracertTrue(tselfthomePostscaleti((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pytdesign!s 







cCs�|jd�x$td�D]}|j||�qW|j�|jd�x$td�D]}|j||�qXW|jd�xWtd�D]I}|j�|jd�|jd|�|j�|jd|�q�W|jd�|j	�j
�dS(Ni6ii$iiHi(RRt	pentpieceRtleftttripieceRRR
t	getscreentupdate(RtinitposRR((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR3s 







cCs�|j�}|j�|jd|�|jd||�|j�|j|�|j|�|j�|jd|�|jd||�|j�|j|�|j|�|jd�|j	�j
�dS(Ng@g�?@iH(theadingRR
ttripolyrRRt
setheadingttripolylRRR(RRRtoldh((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyREs








cCsM|j�}|j�|jd|�|j�x2td�D]$}|jd|�|jd�q>W|jd|d|�|j�|j|�|j|�|jd|�|j�x2td�D]$}|jd|�|jd�q�W|j	d|d|�|j�|j|�|j|�|j
d�|j�j�dS(NiiiiHiK(
RRRRRRtpentrRRtpentlRRR(RRRRR((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyRVs,









cCsM|d|krdS|j|�|j|�|j|d|||�dS(NigR���Q�?(RRR!(RtsidetangR((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR!ns


cCsM|d|krdS|j|�|j|�|j|d|||�dS(NigR���Q�?(RRR (RR"R#R((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR ts


cCs�|d|krdS|j|�|jd�|j|d�|jd�|j|d�|jd�|j|d|�dS(Niiog{�G�z�?g�������?i�g�?(RRR(RR"R((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyRzs



cCs�|d|krdS|j|�|jd�|j|d�|jd�|j|d�|jd�|j|d|�dS(Niiog{�G�z�?g�������?i�g�?(RRR(RR"R((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR�s



cCsM|j|�|j|�|d|kr.dS|j|d|||�dS(Ng@g333333�?(RRR
(RtstaR((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyR
�s


(t__name__t
__module__RRRRR!R RRR
(((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyRs							
	
cCstt�}|jd�|j�|j�jd�|jd�t�}|j|j�d�t�}d||S(Niisruntime: %.2f sec.(	Rtspeedt
hideturtleRtdelayRRRR	(tttattet((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pytmain�s	


		t__main__(t__doc__tmathtturtleRRttimeRRR.R&tmsg(((s4/usr/lib64/python2.7/Demo/turtle/tdemo_bytedesign.pyt<module>su		PK�%�ZrTz��tdemo_clock.pycnu�[����
Afc@s�dZddlTddlmZdd�Zd�Zd�Zd�Zd	�Zd
�Zd�Z	d�Z
d
�Zedkr�e
d�e�ZeGHe�ndS(s�       turtle-example-suite:

             tdemo_clock.py

Enhanced clock-program, showing date
and time
  ------------------------------------
   Press STOP to exit the program!
  ------------------------------------
i����(t*(tdatetimeicCs0t�t|�t|�t|�t�dS(N(tpenuptrighttforwardtlefttpendown(tdistanztwinkel((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytjumps



cCsjt|d�td�t|d�td�t|�td�t|�td�t|d�dS(Ngffffff�?iZg@ix(tfdtrttlt(tlaengetspitze((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pythands





cCsKt�t|d�t�t||�t�t�}t||�dS(Ng333333�?(tresetR	t
begin_polyRtend_polytget_polytregister_shape(tnameR
Rt	hand_form((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytmake_hand_shape"s
	cCs�t�td�xitd�D][}t|�|ddkrZtd�t|d�ntd�t|�td�qWdS(Nii<iiiii(RtpensizetrangeR	R
tdotR(tradiusti((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pyt	clockface+s



cCs2td�tddd�tddd�tddd�td	�t�atjd�tjd
d�t�atjd�tjdd
�t�atjd�tjdd�xDtttfD]3}|j	d�|j
ddd�|jd�q�Wt�t�a
t
j�t
j�t
jd�dS(Ntlogotsecond_handi}itminute_handi�t	hour_handiZi�tgray20tgray80tblue1tred1tblue3tred3tuseriiiiU(tmodeRRtTurtleRtshapetcolorR R!t
resizemodet	shapesizetspeedthttwritertputbk(R((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytsetup8s.

	
	
	

	

cCs)dddddddg}||j�S(NtMondaytTuesdayt	WednesdaytThursdaytFridaytSaturdaytSunday(tweekday(ttt	wochentag((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pyR>Ss	cCs^ddddddddd	d
ddg}|j}||jd
}|j}d|||fS(NsJan.sFeb.sMar.sApr.tMaytJunetJulysAug.sSep.sOct.sNov.sDec.is%s %d %d(tyeartmonthtday(tztmonattjtmR=((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytdatumXs		cCs5tj�}|j|jd}|j|d}|j|d}y�tt�tj	�tj
�tjd�tjt
|�dddd�tjd
�tjt|�dddd�tjd�tt�tjd|�tjd|�tjd
|�tt�ttd�Wntk
r0nXdS(Ng���ư>gN@iAtaligntcentertfonttCourieritboldi�iUiiid(RMiRN(RMiRN(RttodaytsecondtmicrosecondtminutethourttracertFalseR1tclearthomeRtwriteR>tbackRItTrueRt
setheadingR R!tontimerttickt
Terminator(R=tsekundeRRtstunde((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pyR]`s.










cCs&tt�t�tt�t�dS(Nt	EVENTLOOP(RTRUR4RZR](((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytmainys


t__main__RN(t__doc__tturtleRR	RRRR4R>RIR]Rbt__name__R)tmsgtmainloop(((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pyt<module>s 
				
					
	PK�%�Zp||tdemo_I_dontlike_tiltdemo.pyonu�[����
Afc@sMdZddlTddlZd�ZedkrIe�ZeGHe�ndS(s       turtle-example-suite:

     tdemo-I_dont_like_tiltdemo.py

Demonstrates
  (a) use of a tilted ellipse as
      turtle shape
  (b) stamping that shape

We can remove it, if you don't like it.
      Without using reset() ;-)
 ---------------------------------------
i����(t*NcCs�t�td�td�t�tdd�td�t�td�t�tdd	d
�t	dd�x/t
d�D]!}td�td
�t
�q|Wt	dd�x/t
d�D]!}td�td
�t
�q�Wtd�tddd�t	dd�xBt
d�D]4}td�td
�|ddkrt
�qqWtjd�xt�rot�q\Wt�tddddd �dS(!Ntcircletuseriigo���!@iZi-ii
itredtvioletiti�iiitbluetyellowiiis	OK, OVER!taligntcentertfonttCouriertboldsDone!i�(RiR(tresettshapet
resizemodetputbktrttpdttiltt
turtlesizetcolortrangetfdtlttstampttimetsleeptundobufferentriestundothttwrite(ti((s=/usr/lib64/python2.7/Demo/turtle/tdemo_I_dontlike_tiltdemo.pytmainsD














t__main__(t__doc__tturtleRR"t__name__tmsgtmainloop(((s=/usr/lib64/python2.7/Demo/turtle/tdemo_I_dontlike_tiltdemo.pyt<module>s
	%	PK�%�Z�/�..about_turtledemo.txtnu�[���
  --------------------------------------
     About xturtleDemo.py  
  --------------------------------------

  Tiny demo Viewer to view turtle graphics example scripts.

  Quickly and dirtyly assembled by Gregor Lingl.
  June, 2006

  For more information see: xturtleDemo - Help 

  Have fun!
    
PK�%�Z�g��tdemo_lindenmayer_indian.pyonu�[����
Afc@sSdZddlTd�Zd�Zd�ZedkrOe�ZeGHe�ndS(s�       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

i����(t*cCsNxGt|�D]9}d}x$|D]}||j||�}q W|}q
W|S(Nt(trangetget(tseqtreplacementRulestntitnewseqtelement((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytreplaces

cCsWxP|D]H}y||�Wqtk
rNyt|||�WqOqOXqXqWdS(N(t	TypeErrortdraw(tcommandstrulestb((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pyR&s

cCsrd�}d�}d�}i|d6|d6|d6dd6}id	d6}d
}t||d�}t�td�tdd
�t�t�td�t�t||�ddl	m
}|d�d�}d�}	d�}
i|d6|	d6|
d6}idd6dd6}d}
t�td
�tdd
�t�td�t|
|d�}t||�td�dS(NcSstd�dS(Ni-(tright(((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytr7scSstd�dS(Ni-(tleft(((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytl:scSstd�dS(Ng@(tforward(((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytf=st-t+Rsf+f+f--f--f+f+fRsb+f+b--f--b+f+bs
b--f--b--fiiii�i����(tsleepcSstd�tdd�dS(Ntredi
iZ(tcolortcircle(((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytAVs
cSsOddlm}td�d|d�}t|�t|d�t|�dS(Ni����(tsqrttblackiii(tmathRRRR(RR((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytBZs


cSstd�td�dS(Ntgreeni
(RR(((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytFbs
tatafbfat	afbfbfbfatfbfbfbfbi-sDone!(R
tresettspeedttracerthttuptbackwardtdownRttimeRR(RRRtsnake_rulestsnake_replacementRulestsnake_starttdrawingRRR R"t
krishna_rulestkrishna_replacementRulest
krishna_start((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pytmain1s@			"





			




t__main__N(t__doc__tturtleR
RR6t__name__tmsgtmainloop(((s</usr/lib64/python2.7/Demo/turtle/tdemo_lindenmayer_indian.pyt<module>s
			C	PK�%�Z�%�i((tdemo_yinyang.pycnu�[����
Afc@sCdZddlTd�Zd�Zedkr?e�e�ndS(s�       turtle-example-suite:

            tdemo_yinyang.py

Another drawing suitable as a beginner's
programming example.

The small circles are drawn by the circle
command.

i����(t*cCs�td�td�tt�t|dd�t|d�td�t|dd�t|�tt�t|�td�t�t|d�td�t	�t|d�td�tt
�t�t|d�t	�td�dS(Nitblackg@i�iZg�?g�?(twidthtcolortfilltTruetcircletlefttuptforwardtrighttdowntFalsetbackward(tradiustcolor1tcolor2((s1/usr/lib64/python2.7/Demo/turtle/tdemo_yinyang.pytyins,











cCs2t�tddd�tddd�t�dS(Ni�twhiteRsDone!(tresetRtht(((s1/usr/lib64/python2.7/Demo/turtle/tdemo_yinyang.pytmain(s
t__main__N(t__doc__tturtleRRt__name__tmainloop(((s1/usr/lib64/python2.7/Demo/turtle/tdemo_yinyang.pyt<module>s
		PK�%�Z�%�i((tdemo_yinyang.pyonu�[����
Afc@sCdZddlTd�Zd�Zedkr?e�e�ndS(s�       turtle-example-suite:

            tdemo_yinyang.py

Another drawing suitable as a beginner's
programming example.

The small circles are drawn by the circle
command.

i����(t*cCs�td�td�tt�t|dd�t|d�td�t|dd�t|�tt�t|�td�t�t|d�td�t	�t|d�td�tt
�t�t|d�t	�td�dS(Nitblackg@i�iZg�?g�?(twidthtcolortfilltTruetcircletlefttuptforwardtrighttdowntFalsetbackward(tradiustcolor1tcolor2((s1/usr/lib64/python2.7/Demo/turtle/tdemo_yinyang.pytyins,











cCs2t�tddd�tddd�t�dS(Ni�twhiteRsDone!(tresetRtht(((s1/usr/lib64/python2.7/Demo/turtle/tdemo_yinyang.pytmain(s
t__main__N(t__doc__tturtleRRt__name__tmainloop(((s1/usr/lib64/python2.7/Demo/turtle/tdemo_yinyang.pyt<module>s
		PK�%�Z�ʭ��
�
tdemo_fractalcurves.pycnu�[����
Afc@smdZddlTddlmZmZdefd��YZd�Zedkrie�Z	e	GHe
�ndS(	s&      turtle-example-suite:

        tdemo_fractalCurves.py

This program draws two fractal-curve-designs:
(1) A hilbert curve (in a box)
(2) A combination of Koch-curves.

The CurvesTurtle class and the fractal-curve-
methods are taken from the PythonCard example
scripts for turtle-graphics.
i����(t*(tsleeptclocktCurvesTurtlecBs#eZd�Zd�Zd�ZRS(cCs�|dkrdS|j|d�|j||d|�|j|�|j|d�|j||d|�|j|�|j||d|�|j|d�|j|�|j||d|�|j|d�dS(NiiZi(tleftthilberttforwardtright(tselftsizetleveltparity((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyRs


cCs�ddl}d||j|j|�}|j�|j|�|j�|jdd|d|�x8t|�D]*}|j|||�|jd|�quW|j	dd|d|�|j�|j
|�|j�dS(Ni����ii�iZih(tmathtsintpitputfdtpdtrttrangetfractaltlttbk(RtntradtlevtdirRtedgeti((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyt
fractalgon/s




cCs�|dkr|j|�dS|j|d|d|�|jd|�|j|d|d|�|jd|�|j|d|d|�|jd|�|j|d|d|�dS(Niii<ix(RRRR(RtdisttdepthR((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyRBs
(t__name__t
__module__RRR(((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyRs		cCsrt�}|j�|jd�|j�|jdd�|j�d}|jd|d|�|j�t�}|j	d�|j
t�|j|�|j
|dd�|j|�x:td�D],}|jd�|j|d	|d
�q�W|j�x.td
�D] }|j|�|jd�qW|j�x:td�D],}|j|d|d
�|jd�qKW|j
t�t�}d
||}td�|j�|jd�|j�|jdd�t�}|jdd�|j
t�|jdddd�|j
t�|jd�|jdddd�|j
t�t�}|d||7}|S(Niiii���i��trediiZi@iiiBsHilbert: %.2fsec. tblacktbluei�i�i����sKoch: %.2fsec.(RtresettspeedthtttracerRtsetposRRt	fillcolortfilltTrueRRRRRtFalseRtcolorR(tftR	ttaRttbtres((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pytmainNsZ	




	








	



	



	t__main__N(t__doc__tturtlettimeRRtPenRR3R tmsgtmainloop(((s7/usr/lib64/python2.7/Demo/turtle/tdemo_fractalcurves.pyt<module>
s
=	8	PK�%�Z3�
��
tdemo_tree.pynuȯ��#! /usr/bin/python2.7
"""      turtle-example-suite:

             tdemo_tree.py

Displays a 'breadth-first-tree' - in contrast
to the classical Logo tree drawing programs,
which use a depth-first-algorithm.

Uses:
(1) a tree-generator, where the drawing is
quasi the side-effect, whereas the generator
always yields None.
(2) Turtle-cloning: At each branching point
the current pen is cloned. So in the end
there are 1024 turtles.
"""
from turtle import Turtle, mainloop
from time import clock

def tree(plist, l, a, f):
    """ plist is list of pens
    l is length of branch
    a is half of the angle between 2 branches
    f is factor by which branch is shortened
    from level to level."""
    if l > 3:
        lst = []
        for p in plist:
            p.forward(l)
            q = p.clone()
            p.left(a)
            q.right(a)
            lst.append(p)
            lst.append(q)
        for x in tree(lst, l*f, a, f):
            yield None

def maketree():
    p = Turtle()
    p.setundobuffer(None)
    p.hideturtle()
    p.speed(0)
    p.tracer(30,0)
    p.left(90)
    p.penup()
    p.forward(-210)
    p.pendown()
    t = tree([p], 200, 65, 0.6375)
    for x in t:
        pass
    print len(p.getscreen().turtles())

def main():
    a=clock()
    maketree()
    b=clock()
    return "done: %.2f sec." % (b-a)

if __name__ == "__main__":
    msg = main()
    print msg
    mainloop()
PK�%�ZA�g:�	�	tdemo_lindenmayer_indian.pynuȯ��#! /usr/bin/python2.7
"""       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

"""
################################
# Mini Lindenmayer tool
###############################

from turtle import *

def replace( seq, replacementRules, n ):
    for i in range(n):
        newseq = ""
        for element in seq:
            newseq = newseq + replacementRules.get(element,element)
        seq = newseq
    return seq

def draw( commands, rules ):
    for b in commands:
        try:
            rules[b]()
        except TypeError:
            try:
                draw(rules[b], rules)
            except:
                pass


def main():
    ################################
    # Example 1: Snake kolam
    ################################


    def r():
        right(45)

    def l():
        left(45)

    def f():
        forward(7.5)

    snake_rules = {"-":r, "+":l, "f":f, "b":"f+f+f--f--f+f+f"}
    snake_replacementRules = {"b": "b+f+b--f--b+f+b"}
    snake_start = "b--f--b--f"

    drawing = replace(snake_start, snake_replacementRules, 3)

    reset()
    speed(3)
    tracer(1,0)
    ht()
    up()
    backward(195)
    down()
    draw(drawing, snake_rules)

    from time import sleep
    sleep(3)

    ################################
    # Example 2: Anklets of Krishna
    ################################

    def A():
        color("red")
        circle(10,90)

    def B():
        from math import sqrt
        color("black")
        l = 5/sqrt(2)
        forward(l)
        circle(l, 270)
        forward(l)

    def F():
        color("green")
        forward(10)

    krishna_rules = {"a":A, "b":B, "f":F}
    krishna_replacementRules = {"a" : "afbfa", "b" : "afbfbfbfa" }
    krishna_start = "fbfbfbfb"

    reset()
    speed(0)
    tracer(3,0)
    ht()
    left(45)
    drawing = replace(krishna_start, krishna_replacementRules, 3)
    draw(drawing, krishna_rules)
    tracer(1)
    return "Done!"

if __name__=='__main__':
    msg = main()
    print msg
    mainloop()
PK�%�Z��!KKtdemo_tree.pycnu�[����
Afc@sodZddlmZmZddlmZd�Zd�Zd�Ze	dkrke�Z
e
GHe�ndS(	s�      turtle-example-suite:

             tdemo_tree.py

Displays a 'breadth-first-tree' - in contrast
to the classical Logo tree drawing programs,
which use a depth-first-algorithm.

Uses:
(1) a tree-generator, where the drawing is
quasi the side-effect, whereas the generator
always yields None.
(2) Turtle-cloning: At each branching point
the current pen is cloned. So in the end
there are 1024 turtles.
i����(tTurtletmainloop(tclockccs�|dkr�g}x[|D]S}|j|�|j�}|j|�|j|�|j|�|j|�qWx)t|||||�D]}dVq�WndS(s� plist is list of pens
    l is length of branch
    a is half of the angle between 2 branches
    f is factor by which branch is shortened
    from level to level.iN(tforwardtclonetlefttrighttappendttreetNone(tplisttltatftlsttptqtx((s./usr/lib64/python2.7/Demo/turtle/tdemo_tree.pyRs




 cCs�t�}|jd�|j�|jd�|jdd�|jd�|j�|jd�|j	�t
|gddd�}x|D]}q�Wt|j�j
��GHdS(NiiiZi.���i�iAgffffff�?(Rt
setundobufferR	t
hideturtletspeedttracerRtpenupRtpendownRtlent	getscreentturtles(RttR((s./usr/lib64/python2.7/Demo/turtle/tdemo_tree.pytmaketree's	







cCs%t�}t�t�}d||S(Nsdone: %.2f sec.(RR(Rtb((s./usr/lib64/python2.7/Demo/turtle/tdemo_tree.pytmain6s		t__main__N(t__doc__tturtleRRttimeRRRRt__name__tmsg(((s./usr/lib64/python2.7/Demo/turtle/tdemo_tree.pyt<module>s				PK�%�Z^��tdemo_chaos.pycnu�[����
��^c@syddlTdZd�Zd�Zd�Zd�Zd�Zd�Zd	�Zd
�Z	e
dkrue	�e�ndS(
i����(t*iPcCsd|d|S(Ng333333@i((tx((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pytfscCsd||dS(Ng333333@i((R((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pytgscCsd|d||S(Ng333333@((R((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pythscCst�t||�dS(N(tpenuptgoto(Rty((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pytjumptoscCs%t||�t�t||�dS(N(RtpendownR(tx1ty1tx2ty2((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pytlines
cCs.tddtdd�tdddd�dS(Ni����iig��������g�������?(RtN(((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pytcoosysscCspt|�|}td|�t�td�x;tt�D]-}||�}t|d|�td�q;WdS(Niii(tpencolorRR	tdottrangeRR(tfuntstarttcolorRti((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pytplot s


cCs�t�tddtdd�td�t�t�ttdd�ttdd�tt	dd	�x/t
d
�D]!}td|dtdd�qsWdS(
Ng�g��������ig�������?igffffff�?tbluetgreentredidg�?sDone!(tresettsetworldcoordinatesRtspeedt
hideturtleRRRRRR(ts((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pytmain+s
t__main__N(tturtleRRRRRRRRR!t__name__tmainloop(((s//usr/lib64/python2.7/Demo/turtle/tdemo_chaos.pyt<module>s
								PK�%�ZrTz��tdemo_clock.pyonu�[����
Afc@s�dZddlTddlmZdd�Zd�Zd�Zd�Zd	�Zd
�Zd�Z	d�Z
d
�Zedkr�e
d�e�ZeGHe�ndS(s�       turtle-example-suite:

             tdemo_clock.py

Enhanced clock-program, showing date
and time
  ------------------------------------
   Press STOP to exit the program!
  ------------------------------------
i����(t*(tdatetimeicCs0t�t|�t|�t|�t�dS(N(tpenuptrighttforwardtlefttpendown(tdistanztwinkel((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytjumps



cCsjt|d�td�t|d�td�t|�td�t|�td�t|d�dS(Ngffffff�?iZg@ix(tfdtrttlt(tlaengetspitze((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pythands





cCsKt�t|d�t�t||�t�t�}t||�dS(Ng333333�?(tresetR	t
begin_polyRtend_polytget_polytregister_shape(tnameR
Rt	hand_form((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytmake_hand_shape"s
	cCs�t�td�xitd�D][}t|�|ddkrZtd�t|d�ntd�t|�td�qWdS(Nii<iiiii(RtpensizetrangeR	R
tdotR(tradiusti((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pyt	clockface+s



cCs2td�tddd�tddd�tddd�td	�t�atjd�tjd
d�t�atjd�tjdd
�t�atjd�tjdd�xDtttfD]3}|j	d�|j
ddd�|jd�q�Wt�t�a
t
j�t
j�t
jd�dS(Ntlogotsecond_handi}itminute_handi�t	hour_handiZi�tgray20tgray80tblue1tred1tblue3tred3tuseriiiiU(tmodeRRtTurtleRtshapetcolorR R!t
resizemodet	shapesizetspeedthttwritertputbk(R((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytsetup8s.

	
	
	

	

cCs)dddddddg}||j�S(NtMondaytTuesdayt	WednesdaytThursdaytFridaytSaturdaytSunday(tweekday(ttt	wochentag((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pyR>Ss	cCs^ddddddddd	d
ddg}|j}||jd
}|j}d|||fS(NsJan.sFeb.sMar.sApr.tMaytJunetJulysAug.sSep.sOct.sNov.sDec.is%s %d %d(tyeartmonthtday(tztmonattjtmR=((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytdatumXs		cCs5tj�}|j|jd}|j|d}|j|d}y�tt�tj	�tj
�tjd�tjt
|�dddd�tjd
�tjt|�dddd�tjd�tt�tjd|�tjd|�tjd
|�tt�ttd�Wntk
r0nXdS(Ng���ư>gN@iAtaligntcentertfonttCourieritboldi�iUiiid(RMiRN(RMiRN(RttodaytsecondtmicrosecondtminutethourttracertFalseR1tclearthomeRtwriteR>tbackRItTrueRt
setheadingR R!tontimerttickt
Terminator(R=tsekundeRRtstunde((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pyR]`s.










cCs&tt�t�tt�t�dS(Nt	EVENTLOOP(RTRUR4RZR](((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytmainys


t__main__RN(t__doc__tturtleRR	RRRR4R>RIR]Rbt__name__R)tmsgtmainloop(((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pyt<module>s 
				
					
	PK�%�Ziʈ�k'k'
turtleDemo.pynuȯ��#! /usr/bin/python2.7
import sys
import os

from Tkinter import *
from idlelib.Percolator import Percolator
from idlelib.ColorDelegator import ColorDelegator
from idlelib.textView import view_file

import turtle
import time

demo_dir = os.getcwd()
if "turtleDemo.py" not in os.listdir(demo_dir):
    print "Directory of turtleDemo must be current working directory!"
    print "But in your case this is", demo_dir
    sys.exit()

STARTUP = 1
READY = 2
RUNNING = 3
DONE = 4
EVENTDRIVEN = 5

menufont = ("Arial", 12, NORMAL)
btnfont = ("Arial", 12, 'bold')
txtfont = ('Lucida Console', 8, 'normal')

def getExampleEntries():
    entries1 = [entry for entry in os.listdir(demo_dir) if
                     entry.startswith("tdemo_") and
                     not entry.endswith(".pyc")]
    entries2 = []
    for entry in entries1:
        if entry.endswith(".py"):
            entries2.append(entry)
        else:
            path = os.path.join(demo_dir, entry)
            sys.path.append(path)
            subdir = [entry]
            scripts = [script for script in os.listdir(path) if
                            script.startswith("tdemo_") and
                            script.endswith(".py")]
            entries2.append(subdir+scripts)
    return entries2

help_entries = (  # (help_label,  help_file)
    ('Turtledemo help', "demohelp.txt"),
    ('About turtledemo', "about_turtledemo.txt"),
    ('About turtle module', "about_turtle.txt"),
    )

class DemoWindow(object):

    def __init__(self, filename=None):
        self.root = root = turtle._root = Tk()
        root.title('Python turtle-graphics examples')
        root.wm_protocol("WM_DELETE_WINDOW", self._destroy)

        root.grid_rowconfigure(1, weight=1)
        root.grid_columnconfigure(0, weight=1)
        root.grid_columnconfigure(1, minsize=90, weight=1)
        root.grid_columnconfigure(2, minsize=90, weight=1)
        root.grid_columnconfigure(3, minsize=90, weight=1)

        self.mBar = Frame(root, relief=RAISED, borderwidth=2)
        self.ExamplesBtn = self.makeLoadDemoMenu()
        self.OptionsBtn = self.makeHelpMenu()
        self.mBar.grid(row=0, columnspan=4, sticky='news')

        pane = PanedWindow(orient=HORIZONTAL, sashwidth=5,
                           sashrelief=SOLID, bg='#ddd')
        pane.add(self.makeTextFrame(pane))
        pane.add(self.makeGraphFrame(pane))
        pane.grid(row=1, columnspan=4, sticky='news')

        self.output_lbl = Label(root, height= 1, text=" --- ", bg="#ddf",
                                font=("Arial", 16, 'normal'), borderwidth=2,
                                relief=RIDGE)
        self.start_btn = Button(root, text=" START ", font=btnfont,
                                fg="white", disabledforeground = "#fed",
                                command=self.startDemo)
        self.stop_btn = Button(root, text=" STOP ", font=btnfont,
                               fg="white", disabledforeground = "#fed",
                               command=self.stopIt)
        self.clear_btn = Button(root, text=" CLEAR ", font=btnfont,
                                fg="white", disabledforeground="#fed",
                                command = self.clearCanvas)
        self.output_lbl.grid(row=2, column=0, sticky='news', padx=(0,5))
        self.start_btn.grid(row=2, column=1, sticky='ew')
        self.stop_btn.grid(row=2, column=2, sticky='ew')
        self.clear_btn.grid(row=2, column=3, sticky='ew')

        Percolator(self.text).insertfilter(ColorDelegator())
        self.dirty = False
        self.exitflag = False
        if filename:
            self.loadfile(filename)
        self.configGUI(NORMAL, DISABLED, DISABLED, DISABLED,
                       "Choose example from menu", "black")
        self.state = STARTUP


    def onResize(self, event):
        cwidth = self._canvas.winfo_width()
        cheight = self._canvas.winfo_height()
        self._canvas.xview_moveto(0.5*(self.canvwidth-cwidth)/self.canvwidth)
        self._canvas.yview_moveto(0.5*(self.canvheight-cheight)/self.canvheight)

    def makeTextFrame(self, root):
        self.text_frame = text_frame = Frame(root)
        self.text = text = Text(text_frame, name='text', padx=5,
                                wrap='none', width=45)

        self.vbar = vbar = Scrollbar(text_frame, name='vbar')
        vbar['command'] = text.yview
        vbar.pack(side=LEFT, fill=Y)
        self.hbar = hbar = Scrollbar(text_frame, name='hbar', orient=HORIZONTAL)
        hbar['command'] = text.xview
        hbar.pack(side=BOTTOM, fill=X)

        text['font'] = txtfont
        text['yscrollcommand'] = vbar.set
        text['xscrollcommand'] = hbar.set
        text.pack(side=LEFT, fill=BOTH, expand=1)
        return text_frame

    def makeGraphFrame(self, root):
        turtle._Screen._root = root
        self.canvwidth = 1000
        self.canvheight = 800
        turtle._Screen._canvas = self._canvas = canvas = turtle.ScrolledCanvas(
                root, 800, 600, self.canvwidth, self.canvheight)
        canvas.adjustScrolls()
        canvas._rootwindow.bind('<Configure>', self.onResize)
        canvas._canvas['borderwidth'] = 0

        self.screen = _s_ = turtle.Screen()
        turtle.TurtleScreen.__init__(_s_, _s_._canvas)
        self.scanvas = _s_._canvas
        turtle.RawTurtle.screens = [_s_]
        return canvas

    def configGUI(self, menu, start, stop, clear, txt="", color="blue"):
        self.ExamplesBtn.config(state=menu)

        self.start_btn.config(state=start,
                              bg="#d00" if start == NORMAL else "#fca")
        self.stop_btn.config(state=stop,
                             bg="#d00" if stop == NORMAL else "#fca")
        self.clear_btn.config(state=clear,
                              bg="#d00" if clear == NORMAL else"#fca")
        self.output_lbl.config(text=txt, fg=color)

    def makeLoadDemoMenu(self):
        CmdBtn = Menubutton(self.mBar, text='Examples',
                            underline=0, font=menufont)
        CmdBtn.pack(side=LEFT, padx="2m")
        CmdBtn.menu = Menu(CmdBtn)

        for entry in getExampleEntries():
            def loadexample(x):
                def emit():
                    self.loadfile(x)
                return emit
            if isinstance(entry,str):
                CmdBtn.menu.add_command(label=entry[6:-3], underline=0,
                                        font=menufont,
                                        command=loadexample(entry))
            else:
                _dir, entries = entry[0], entry[1:]
                CmdBtn.menu.choices = Menu(CmdBtn.menu)
                for e in entries:
                    CmdBtn.menu.choices.add_command(
                            label=e[6:-3], underline=0, font=menufont,
                            command = loadexample(os.path.join(_dir,e)))
                CmdBtn.menu.add_cascade(
                    label=_dir[6:], menu = CmdBtn.menu.choices, font=menufont)

        CmdBtn['menu'] = CmdBtn.menu
        return CmdBtn

    def makeHelpMenu(self):
        CmdBtn = Menubutton(self.mBar, text='Help', underline=0, font = menufont)
        CmdBtn.pack(side=LEFT, padx='2m')
        CmdBtn.menu = Menu(CmdBtn)

        for help_label, help_file in help_entries:
            def show(help_label=help_label, help_file=help_file):
                view_file(self.root, help_label, os.path.join(demo_dir, help_file))
            CmdBtn.menu.add_command(label=help_label, font=menufont, command=show)

        CmdBtn['menu'] = CmdBtn.menu
        return CmdBtn

    def refreshCanvas(self):
        if not self.dirty: return
        self.screen.clear()
        self.dirty=False

    def loadfile(self,filename):
        self.refreshCanvas()
        if os.path.exists(filename) and not os.path.isdir(filename):
            # load and display file text
            f = open(filename,'r')
            chars = f.read()
            f.close()
            self.text.delete("1.0", "end")
            self.text.insert("1.0",chars)
            direc, fname = os.path.split(filename)
            self.root.title(fname[6:-3]+" - a Python turtle graphics example")
            self.module = __import__(fname[:-3])
            self.configGUI(NORMAL, NORMAL, DISABLED, DISABLED,
                           "Press start button", "red")
            self.state = READY

    def startDemo(self):
        self.refreshCanvas()
        self.dirty = True
        turtle.TurtleScreen._RUNNING = True
        self.configGUI(DISABLED, DISABLED, NORMAL, DISABLED,
                       "demo running...", "black")
        self.screen.clear()
        self.screen.mode("standard")
        self.state = RUNNING

        try:
            result = self.module.main()
            if result == "EVENTLOOP":
                self.state = EVENTDRIVEN
            else:
                self.state = DONE
        except turtle.Terminator:
            if self.root is None:
                return
            self.state = DONE
            result = "stopped!"
        if self.state == DONE:
            self.configGUI(NORMAL, NORMAL, DISABLED, NORMAL,
                           result)
        elif self.state == EVENTDRIVEN:
            self.exitflag = True
            self.configGUI(DISABLED, DISABLED, NORMAL, DISABLED,
                           "use mouse/keys or STOP", "red")

    def clearCanvas(self):
        self.refreshCanvas()
        self.scanvas.config(cursor="")
        self.configGUI(NORMAL, NORMAL, DISABLED, DISABLED)

    def stopIt(self):
        if self.exitflag:
            self.clearCanvas()
            self.exitflag = False
            self.configGUI(NORMAL, NORMAL, DISABLED, DISABLED,
                           "STOPPED!", "red")
            turtle.TurtleScreen._RUNNING = False
        else:
            turtle.TurtleScreen._RUNNING = False

    def _destroy(self):
        turtle.TurtleScreen._RUNNING = False
        self.root.destroy()
        self.root = None
        #sys.exit()

def main():
    demo = DemoWindow()
    demo.root.mainloop()

if __name__ == '__main__':
    main()
PK�%�Z�w�[��tdemo_wikipedia.pyonu�[����
��^c@srdZddlmZmZmZddlmZmZd�Zd�Z	e
dkrne	�ZeGHe�ndS(sF      turtle-example-suite:

          tdemo_wikipedia3.py

This example is
inspired by the Wikipedia article on turtle
graphics. (See example wikipedia1 for URLs)

First we create (ne-1) (i.e. 35 in this
example) copies of our first turtle p.
Then we let them perform their steps in
parallel.

Followed by a complete undo().
i����(tScreentTurtletmainloop(tclocktsleepcCs�|g}xGtd|�D]6}|j�}|jd|�|j|�|}qWxvt|�D]h}t|d|�|d}xC|D];}|jd|�|jd|d|�|j|�q�Wq`WdS(Nig�v@g@gffffff�?i(trangetclonetrttappendtabstpencolortfd(tptnetszt
turtlelisttitqtctt((s3/usr/lib64/python2.7/Demo/turtle/tdemo_wikipedia.pytmn_ecks	


cCst�}|jd�t�}|jd�|j�|jd�|jd�|jdd�t�}t	|dd�t�}||}t
d�t�}xPtg|j�D]}|j
�^q��r�x|j�D]}|j�q�Wq�Wt�}d|||S(	Ntblackitredii$iisLaufzeit: %.3f sec(RtbgcolorRtspeedt
hideturtleR
tpensizettracerRRRtanytturtlestundobufferentriestundo(tsRtattettz1R((s3/usr/lib64/python2.7/Demo/turtle/tdemo_wikipedia.pytmain$s&	
	



		

	.	t__main__N(t__doc__tturtleRRRttimeRRRR$t__name__tmsg(((s3/usr/lib64/python2.7/Demo/turtle/tdemo_wikipedia.pyt<module>s			PK�%�Z}��W�$�$
tdemo_nim.pyonu�[����
��^c@s5dZddlZddlZddlZdZdZdZdZedZeedd	edd
Z	dZ
dZdZd�Z
d�Zd�Zdefd��YZdejfd��YZdefd��YZdefd��YZdefd��YZd�Zedkr1e�ej�ndS( s�      turtle-example-suite:

            tdemo_nim.py

Play nim against the computer. The player
who takes the last stick is the winner.

Implements the model-view-controller
design pattern.
i����Ni�i�iiiiiii?i�i�cCstjtt�S(N(trandomtrandintt	MINSTICKSt	MAXSTICKS(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyt	randomrowscCsy|d|dA|dA}|dkr0t|�SxBtd�D]4}|||A}|||kr=||f}|Sq=WdS(Niiii(t
randommovetrange(tstatetxoredtztstmove((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pytcomputerzug!s
cCsot|�}x6trDtjdd�}|||dkkrPqqWtj|dk||d�}||fS(Niii(tmaxtTrueRR(RtmR	trand((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR+s	 tNimModelcBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs
||_dS(N(tgame(tselfR((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyt__init__6scCsr|jjtjtjgkr"dSt�t�t�g|_d|_d|_	|jj
j�tj|j_dS(Ni(
RRtNimtCREATEDtOVERRtstickstplayertNonetwinnertviewtsetuptRUNNING(R((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR9s		cCs�|j|}||j|<|jjj||||j�|j�rstj|j_|j|_	|jjj
�nI|jdkr�d|_t|j�\}}|j||�d|_ndS(Nii(
RRRtnotify_moveRt	game_overRRRRtnotify_overRR(Rtrowtcolt	maxspalte((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRBs

	cCs|jdddgkS(Ni(R(R((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR PscCs+|j||krdS|j||�dS(N(RR(RR"R#((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRSs(t__name__t
__module__RRRR R(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR5s
					tStickcBs#eZd�Zd�Zd�ZRS(cCs�tjj|dt�||_||_||_|j||�\}}|jd�|j	t
dtd�|jd�|j
�|j||�|jd�|j�dS(Ntvisibletsquareg$@g4@itwhite(tturtletTurtleRtFalseR"R#Rtcoordstshapet	shapesizetHUNITtWUNITtspeedtputgototcolort
showturtle(RR"R#Rtxty((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRZs			



cCskt|d�\}}dd|d|t}dd|t}|tdtdtd|tdfS(Niiii(tdivmodR2R1tSCREENWIDTHtSCREENHEIGHT(RR"R#tpackett	remainderR8R9((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR.hscCs9|jjtjkrdS|jjj|j|j�dS(N(RRRRt
controllerRR"R#(RR8R9((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pytmakemovens(R%R&RR.R@(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR'Ys		tNimViewcBsAeZd�Zdd�Zd�Zd�Zd�Zd�ZRS(cCs�||_|j|_|j|_|jjd�|jjt�|jjd�tjdt�|_	|j	j
�|j	jd�i|_xJt
d�D]<}x3t
t�D]%}t|||�|j||f<q�Wq�W|jd�|jjt�dS(Ni�i�R(iis... a moment please ...(i�i�i�(Rtscreentmodelt	colormodettracerR-tbgcolorR+R,twriterR4R3RRRR'tdisplayR(RRR"R#((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRus	
	'
cCs�|jjt�|jj�|dk	rt|jjdtdd�|jjd�|jj	|dddd�n|jjdtdd�|jjd�|jj	|dddd�|jjt
�dS(Niii0tredtaligntcentertfonttCourieritbolditblacki(RMiRN(RMiRN(RBRER-RGtclearRR5R<tpencolortwriteR(Rtmsg1tmsg2((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRH�s
cCs�|jjt�xOtd�D]A}x8t|jj|�D] }|j||fjt�q:WqWxRtd�D]D}x;t|jj|t�D] }|j||fjd�q�WqoW|j	d�|jjt
�dS(NiR*s*Your turn! Click leftmost stick to remove.(RBRER-RRCRR6tSCOLORRRHR(RR"R#((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s" "
cCs�|dkrIt}x�t||�D] }|j||fj|�q"Wn�|jd�tjd�|jd�t}xIt|d|dd�D]-}tjd�|j||fj|�q�W|jd�dS(	Nis ... thinking ...         g�?s ... thinking ... aaah ...ii����g�������?s*Your turn! Click leftmost stick to remove.(tHCOLORRRR6RHttimetsleeptCOLOR(RR"R#R$RtfarbeR
((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s!


!
cCs8|jjjdkrd}nd}|jd|�dS(NisCongrats. You're the winner!!!s"Sorry, the computer is the winner.s2To play again press space bar. To leave press ESC.(RRCRRH(RRT((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR!�s	cCs)|jjtjkr%|jj�ndS(N(RRRRRBRP(R((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRP�sN(	R%R&RRRHRRR!RP(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRAts	
			t
NimControllercBseZd�Zd�ZRS(cCs�||_|jj|_t|_x'|jj�D]}|j|j�q1W|jjj	|jj
jd�|jjj	|jjjd�|jjj
d�|jjj�dS(NtspacetEscapesPress space bar to start game(RRRR-tBUSYtvaluestonclickR@RBtonkeyRCRRPRHtlisten(RRtstick((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s		cCs9|jr
dSt|_|jjj||�t|_dS(N(R^RRRCRR-(RR"R#((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s
		(R%R&RR(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR[�s	RcBs#eZdZdZdZd�ZRS(iiicCsFtj|_||_t|�|_t|�|_t|�|_	dS(N(
RRRRBRRCRARR[R?(RRB((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s
	(R%R&RRRR(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�scCs9tj�}|jd�|jtt�t|�}dS(Ntstandards
EVENTLOOP!(R+tScreentmodeRR;R<R(t
mainscreentnim((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pytmain�s

t__main__(i?i?i(i�i�i�(i�i�i�(t__doc__R+RRWR;R<RRR1R2RURVRYRRRtobjectRR,R'RAR[RRiR%tmainloop(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyt<module>
s0
		
	
$E	PK�%�Z�v�	11tdemo_I_dontlike_tiltdemo.pynuȯ��PK�%�Zp��zz}tdemo_bytedesign.pynuȯ��PK�%�Zp��x:tdemo_planet_and_moon.pynuȯ��PK�%�Z�ʏ
�
�
� tdemo_penrose.pynuȯ��PK�%�Z�j�N=	=	�.tdemo_colormixer.pycnu�[���PK�%�Z}��W�$�$
8tdemo_nim.pycnu�[���PK�%�Z8Hw�*�*�\turtleDemo.pycnu�[���PK�%�Z���CC�tdemo_wikipedia.pynu�[���PK�%�Z��!KK��tdemo_tree.pyonu�[���PK�%�Z�ʭ��
�
�tdemo_fractalcurves.pyonu�[���PK�%�Zؿy��
�
�about_turtle.txtnu�[���PK�%�Z:�B�mm�tdemo_paint.pycnu�[���PK�%�Z�z���ʹdemohelp.txtnu�[���PK�%�Z�g����tdemo_lindenmayer_indian.pycnu�[���PK�%�Zu��Ucc>�tdemo_two_canvases.pycnu�[���PK�%�ZH�B�		��tdemo_paint.pynuȯ��PK�%�Z�{P�.�tdemo_minimal_hanoi.pynuȯ��PK�%�Z�j�N=	=	u�tdemo_colormixer.pyonu�[���PK�%�Z�:8�''��tdemo_yinyang.pynuȯ��PK�%�Z�S�;Q
Q
]�tdemo_fractalcurves.pynuȯ��PK�%�Z�3'vuu�tdemo_penrose.pyonu�[���PK�%�ZPX��''�tdemo_minimal_hanoi.pycnu�[���PK�%�ZJȤ��
)turtle.cfgnu�[���PK�%�ZPX��''�)tdemo_minimal_hanoi.pyonu�[���PK�%�ZUW�p��`8tdemo_planet_and_moon.pycnu�[���PK�%�Z�::`Jtdemo_colormixer.pynu�[���PK�%�ZM�krr�Otdemo_nim.pynu�[���PK�%�Z�H�ll�itdemo_peace.pyonu�[���PK�%�Z�w�[��6otdemo_wikipedia.pycnu�[���PK�%�Z�H�llwtdemo_peace.pycnu�[���PK�%�Ztn*ܷ��|tdemo_chaos.pynu�[���PK�%�Z:�B�mm��tdemo_paint.pyonu�[���PK�%�Z��j%))h�tdemo_peace.pynuȯ��PK�%�Z^��όtdemo_chaos.pyonu�[���PK�%�Z�������tdemo_clock.pynuȯ��PK�%�Zp||עtdemo_I_dontlike_tiltdemo.pycnu�[���PK�%�ZUW�p����tdemo_planet_and_moon.pyonu�[���PK�%�Z8Hw�*�*��turtleDemo.pyonu�[���PK�%�Z�F\�����tdemo_bytedesign.pyonu�[���PK�%�Z�3'vuu��tdemo_penrose.pycnu�[���PK�%�Zu��Ucc]tdemo_two_canvases.pyonu�[���PK�%�ZH}�``tdemo_two_canvases.pynu�[���PK�%�Z�F\����tdemo_bytedesign.pycnu�[���PK�%�ZrTz���3tdemo_clock.pycnu�[���PK�%�Zp||�Etdemo_I_dontlike_tiltdemo.pyonu�[���PK�%�Z�/�..oLabout_turtledemo.txtnu�[���PK�%�Z�g���Mtdemo_lindenmayer_indian.pyonu�[���PK�%�Z�%�i((?\tdemo_yinyang.pycnu�[���PK�%�Z�%�i((�atdemo_yinyang.pyonu�[���PK�%�Z�ʭ��
�
gtdemo_fractalcurves.pycnu�[���PK�%�Z3�
��
utdemo_tree.pynuȯ��PK�%�ZA�g:�	�	�ztdemo_lindenmayer_indian.pynuȯ��PK�%�Z��!KK��tdemo_tree.pycnu�[���PK�%�Z^��/�tdemo_chaos.pycnu�[���PK�%�ZrTz��f�tdemo_clock.pyonu�[���PK�%�Ziʈ�k'k'
\�turtleDemo.pynuȯ��PK�%�Z�w�[���tdemo_wikipedia.pyonu�[���PK�%�Z}��W�$�$
��tdemo_nim.pyonu�[���PK::��