Current File : /home/mmdealscpanel/yummmdeals.com/turtledemo.zip
PK�Q�Z�X�::__init__.pynu�[���"""
    --------------------------------------
        About this viewer
    --------------------------------------

    Tiny demo viewer to view turtle graphics example scripts.

    Quickly and dirtyly assembled by Gregor Lingl.
    June, 2006

    For more information see: turtledemo - Help

    Have fun!
"""
PK�Q�Zؠ�"��
bytedesign.pynuȯ��#! /usr/bin/python3.8
"""      turtle-example-suite:

        tdemo_bytedesign.py

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

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.
"""

from turtle import Turtle, mainloop
from time import perf_counter as 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.getscreen().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.getscreen().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�Q�Zb��))peace.pynuȯ��#! /usr/bin/python3.8
"""       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�Q�Z�+z�minimal_hanoi.pynuȯ��#! /usr/bin/python3.8
"""       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�Q�Z*�)QQ
rosette.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 perf_counter as 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 "runtime: %.3f sec" % (z1+et-at)


if __name__ == '__main__':
    msg = main()
    print(msg)
    mainloop()
PK�Q�Z��XH�7�7__main__.pynu�[���
"""
  ----------------------------------------------
      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!

  The demo viewer windows can be resized. The divider between text
  and canvas can be moved by grabbing it with the mouse. The text font
  size can be changed from the menu and with Control/Command '-'/'+'.
  It can also be changed on most systems with Control-mousewheel
  when the mouse is over the text.

  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, such as clock.py are those which run EVENTDRIVEN.

      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

   - Place the file in the same directory as turtledemo/__main__.py
     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 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 open

    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.)
"""
import sys
import os

from tkinter import *
from idlelib.colorizer import ColorDelegator, color_config
from idlelib.percolator import Percolator
from idlelib.textview import view_text
from turtledemo import __doc__ as about_turtledemo

import turtle

demo_dir = os.path.dirname(os.path.abspath(__file__))
darwin = sys.platform == 'darwin'

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

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

MINIMUM_FONT_SIZE = 6
MAXIMUM_FONT_SIZE = 100
font_sizes = [8, 9, 10, 11, 12, 14, 18, 20, 22, 24, 30]

def getExampleEntries():
    return [entry[:-3] for entry in os.listdir(demo_dir) if
            entry.endswith(".py") and entry[0] != '_']

help_entries = (  # (help_label,  help_doc)
    ('Turtledemo help', __doc__),
    ('About turtledemo', about_turtledemo),
    ('About turtle module', turtle.__doc__),
    )



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)

        if darwin:
            import subprocess
            # Make sure we are the currently activated OS X application
            # so that our menu bar appears.
            subprocess.run(
                    [
                        'osascript',
                        '-e', 'tell application "System Events"',
                        '-e', 'set frontmost of the first process whose '
                              'unix id is {} to true'.format(os.getpid()),
                        '-e', 'end tell',
                    ],
                    stderr=subprocess.DEVNULL,
                    stdout=subprocess.DEVNULL,)

        root.grid_rowconfigure(0, 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 = Menu(root, relief=RAISED, borderwidth=2)
        self.mBar.add_cascade(menu=self.makeLoadDemoMenu(self.mBar),
                              label='Examples', underline=0)
        self.mBar.add_cascade(menu=self.makeFontMenu(self.mBar),
                              label='Fontsize', underline=0)
        self.mBar.add_cascade(menu=self.makeHelpMenu(self.mBar),
                              label='Help', underline=0)
        root['menu'] = self.mBar

        pane = PanedWindow(orient=HORIZONTAL, sashwidth=5,
                           sashrelief=SOLID, bg='#ddd')
        pane.add(self.makeTextFrame(pane))
        pane.add(self.makeGraphFrame(pane))
        pane.grid(row=0, 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=1, column=0, sticky='news', padx=(0,5))
        self.start_btn.grid(row=1, column=1, sticky='ew')
        self.stop_btn.grid(row=1, column=2, sticky='ew')
        self.clear_btn.grid(row=1, column=3, sticky='ew')

        Percolator(self.text).insertfilter(ColorDelegator())
        self.dirty = False
        self.exitflag = False
        if filename:
            self.loadfile(filename)
        self.configGUI(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)
        color_config(text)

        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['yscrollcommand'] = vbar.set
        text['xscrollcommand'] = hbar.set

        text['font'] = tuple(txtfont)
        shortcut = 'Command' if darwin else 'Control'
        text.bind_all('<%s-minus>' % shortcut, self.decrease_size)
        text.bind_all('<%s-underscore>' % shortcut, self.decrease_size)
        text.bind_all('<%s-equal>' % shortcut, self.increase_size)
        text.bind_all('<%s-plus>' % shortcut, self.increase_size)
        text.bind('<Control-MouseWheel>', self.update_mousewheel)
        text.bind('<Control-Button-4>', self.increase_size)
        text.bind('<Control-Button-5>', self.decrease_size)

        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 set_txtsize(self, size):
        txtfont[1] = size
        self.text['font'] = tuple(txtfont)
        self.output_lbl['text'] = 'Font size %d' % size

    def decrease_size(self, dummy=None):
        self.set_txtsize(max(txtfont[1] - 1, MINIMUM_FONT_SIZE))
        return 'break'

    def increase_size(self, dummy=None):
        self.set_txtsize(min(txtfont[1] + 1, MAXIMUM_FONT_SIZE))
        return 'break'

    def update_mousewheel(self, event):
        # For wheel up, event.delta = 120 on Windows, -1 on darwin.
        # X-11 sends Control-Button-4 event instead.
        if (event.delta < 0) == (not darwin):
            return self.decrease_size()
        else:
            return self.increase_size()

    def configGUI(self, start, stop, clear, txt="", color="blue"):
        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, master):
        menu = Menu(master)

        for entry in getExampleEntries():
            def load(entry=entry):
                self.loadfile(entry)
            menu.add_command(label=entry, underline=0,
                             font=menufont, command=load)
        return menu

    def makeFontMenu(self, master):
        menu = Menu(master)
        menu.add_command(label="Decrease (C-'-')", command=self.decrease_size,
                         font=menufont)
        menu.add_command(label="Increase (C-'+')", command=self.increase_size,
                         font=menufont)
        menu.add_separator()

        for size in font_sizes:
            def resize(size=size):
                self.set_txtsize(size)
            menu.add_command(label=str(size), underline=0,
                             font=menufont, command=resize)
        return menu

    def makeHelpMenu(self, master):
        menu = Menu(master)

        for help_label, help_file in help_entries:
            def show(help_label=help_label, help_file=help_file):
                view_text(self.root, help_label, help_file)
            menu.add_command(label=help_label, font=menufont, command=show)
        return menu

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

    def loadfile(self, filename):
        self.clearCanvas()
        turtle.TurtleScreen._RUNNING = False
        modname = 'turtledemo.' + filename
        __import__(modname)
        self.module = sys.modules[modname]
        with open(self.module.__file__, 'r') as f:
            chars = f.read()
        self.text.delete("1.0", "end")
        self.text.insert("1.0", chars)
        self.root.title(filename + " - a Python turtle graphics example")
        self.configGUI(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, 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, DISABLED, NORMAL,
                           result)
        elif self.state == EVENTDRIVEN:
            self.exitflag = True
            self.configGUI(DISABLED, NORMAL, DISABLED,
                           "use mouse/keys or STOP", "red")

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

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

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


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

if __name__ == '__main__':
    main()
PK�Q�Z���ց	�	lindenmayer.pynuȯ��#! /usr/bin/python3.8
"""       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�Q�Zu��=

paint.pynuȯ��#! /usr/bin/python3.8
"""       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 toggles between 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�Q�Z�W쭕�	forest.pynuȯ��#! /usr/bin/python3.8
"""     turtlegraphics-example-suite:

             tdemo_forest.py

Displays a 'forest' of 3 breadth-first-trees
similar to the one in tree.
For further remarks see tree.py

This example is a 'breadth-first'-rewrite of
a Logo program written by Erich Neuwirth. See
http://homepage.univie.ac.at/erich.neuwirth/
"""
from turtle import Turtle, colormode, tracer, mainloop
from random import randrange
from time import perf_counter as clock

def symRandom(n):
    return randrange(-n,n+1)

def randomize( branchlist, angledist, sizedist ):
    return [ (angle+symRandom(angledist),
              sizefactor*1.01**symRandom(sizedist))
                     for angle, sizefactor in branchlist ]

def randomfd( t, distance, parts, angledist ):
    for i in range(parts):
        t.left(symRandom(angledist))
        t.forward( (1.0 * distance)/parts )

def tree(tlist, size, level, widthfactor, branchlists, angledist=10, sizedist=5):
    # benutzt Liste von turtles und Liste von Zweiglisten,
    # fuer jede turtle eine!
    if level > 0:
        lst = []
        brs = []
        for t, branchlist in list(zip(tlist,branchlists)):
            t.pensize( size * widthfactor )
            t.pencolor( 255 - (180 - 11 * level + symRandom(15)),
                        180 - 11 * level + symRandom(15),
                        0 )
            t.pendown()
            randomfd(t, size, level, angledist )
            yield 1
            for angle, sizefactor in branchlist:
                t.left(angle)
                lst.append(t.clone())
                brs.append(randomize(branchlist, angledist, sizedist))
                t.right(angle)
        for x in tree(lst, size*sizefactor, level-1, widthfactor, brs,
                      angledist, sizedist):
            yield None


def start(t,x,y):
    colormode(255)
    t.reset()
    t.speed(0)
    t.hideturtle()
    t.left(90)
    t.penup()
    t.setpos(x,y)
    t.pendown()

def doit1(level, pen):
    pen.hideturtle()
    start(pen, 20, -208)
    t = tree( [pen], 80, level, 0.1, [[ (45,0.69), (0,0.65), (-45,0.71) ]] )
    return t

def doit2(level, pen):
    pen.hideturtle()
    start(pen, -135, -130)
    t = tree( [pen], 120, level, 0.1, [[ (45,0.69), (-45,0.71) ]] )
    return t

def doit3(level, pen):
    pen.hideturtle()
    start(pen, 190, -90)
    t = tree( [pen], 100, level, 0.1, [[ (45,0.7), (0,0.72), (-45,0.65) ]] )
    return t

# Hier 3 Baumgeneratoren:
def main():
    p = Turtle()
    p.ht()
    tracer(75,0)
    u = doit1(6, Turtle(undobuffersize=1))
    s = doit2(7, Turtle(undobuffersize=1))
    t = doit3(5, Turtle(undobuffersize=1))
    a = clock()
    while True:
        done = 0
        for b in u,s,t:
            try:
                b.__next__()
            except:
                done += 1
        if done == 3:
            break

    tracer(1,10)
    b = clock()
    return "runtime: %.2f sec." % (b-a)

if __name__ == '__main__':
    main()
    mainloop()
PK�Q�Z�%<�xxtree.pynuȯ��#! /usr/bin/python3.8
"""      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 perf_counter as 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.getscreen().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

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

if __name__ == "__main__":
    msg = main()
    print(msg)
    mainloop()
PK�Q�ZJȤ��
turtle.cfgnu�[���width = 800
height = 600
canvwidth = 1200
canvheight = 900
shape = arrow
mode = standard
resizemode = auto
fillcolor = ""
title = Python turtle graphics demo.

PK�Q�Z��K�`` __pycache__/peace.cpython-38.pycnu�[���U

e5d)�@s,dZddlTdd�Zedkr(e�e�dS)z�       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.
�)�*cCs
d}t�t�t�tdd�td�|D]@}t|�t�td�t�td�t	d�td�t
d�q,td�td	�td
d�t�td�t	d�td
�t�t	d�td�t
d�t�td�t�td�t	d�t�td�t�td
d�dS)N)Zred3ZorangeZyellowZ	seagreen4Zorchid4Z
royalblue1Zdodgerblue4i����i=����Fi��Z�B�ZwhiteriV����iT��-i,zDone!)�resetZScreenZupZgoto�widthZcolorZdownZforwardZbackward�left�rightZcircle)ZpeacecolorsZpcolor�r�(/usr/lib64/python3.8/turtledemo/peace.py�mainsH



r�__main__N)�__doc__Zturtler�__name__Zmainlooprrrr�<module>s

-PK�Q�Z��<��%__pycache__/bytedesign.cpython-38.pycnu�[���U

e5d��@sXdZddlmZmZddlmZGdd�de�Zdd�Ze	dkrTe�Z
ee
�e�d	S)
a�      turtle-example-suite:

        tdemo_bytedesign.py

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

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.
�)�Turtle�mainloop)�perf_counterc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�DesignercCs�|��td�D]J}|�d|�|��|�|��|�|��|�d|�|�d�q|��|�|�|�d�|�d|�|�d�|��|�	d|d|�|�
��d	�dS)
N�g�����)P@�H�$g�8@���.g������a@T)�up�range�forward�down�wheel�position�backward�right�goto�centerpiece�	getscreen�tracer)�selfZhomePos�scale�i�r�-/usr/lib64/python3.8/turtledemo/bytedesign.py�design s 


zDesigner.designcCs�|�d�td�D]}|�||�q|��|�d�td�D]}|�||�q>|�d�td�D]:}|��|�d�|�d|�|��|�d|�qb|�d�|�	��
�dS)N�6�rrr�)rr�	pentpiecer�left�tripiecer
rrr�update)r�initposrrrrrr2s 




zDesigner.wheelcCs�|��}|��|�d|�|�d||�|��|�|�|�|�|��|�d|�|�d||�|��|�|�|�|�|�d�|�	��
�dS)Ng@g�?@r)�headingrr�tripolyrrr�
setheading�tripolylr!rr#)rr$r�oldhrrrr"Ds




zDesigner.tripiececCs�|��}|��|�d|�|��td�D]}|�d|�|�d�q.|�d|d|�|��|�|�|�|�|�d|�|��td�D]}|�d|�|�d�q�|�	d|d|�|��|�|�|�|�|�
d�|����dS)N�r�r�K)
r%rr
rrr�pentrrr'�pentlr!rr#)rr$rr)rrrrr Us,




zDesigner.pentpiececCs>|d|krdS|�|�|�|�|�|d|||�dS�N�gR���Q�?)r
r!r.�r�sideZangrrrrr.ms


zDesigner.pentlcCs>|d|krdS|�|�|�|�|�|d|||�dSr/)r
rr-r1rrrr-ss


zDesigner.pentrcCsh|d|krdS|�|�|�d�|�|d�|�d�|�|d�|�d�|�|d|�dS�Nr�og{�G�z�?g�������?�g�?)r
rr&�rr2rrrrr&ys



zDesigner.tripolyrcCsh|d|krdS|�|�|�d�|�|d�|�d�|�|d�|�d�|�|d|�dSr3)r
r!r(r6rrrr(�s



zDesigner.tripolylcCs>|�|�|�|�|d|kr$dS|�|d|||�dS)Ng@g333333�?)r
r!r)r�s�arrrrr�s


zDesigner.centerpieceN)�__name__�
__module__�__qualname__rrr"r r.r-r&r(rrrrrrs

rcCs\t�}|�d�|��|���d�|���d�t�}|�|��d�t�}d||S)Nrr0zruntime: %.2f sec.)	rZspeedZ
hideturtlerZdelayr�clockrr)�tZatZetrrr�main�s
r>�__main__N)�__doc__Zturtlerr�timerr<rr>r9�msg�printrrrr�<module>suPK�Q�Z�V��0__pycache__/sorting_animate.cpython-38.opt-2.pycnu�[���U

��.e��@s�ddlTddlZGdd�de�ZGdd�de�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
d$dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!Zd"Zed#kr�e�Ze�dS)%�)�*Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�BlockcCsF||_tj|ddd�|��|�|ddd�|�d�|��dS)NZsquareF)�shapeZvisibleg�?��black)�size�Turtle�__init__Zpu�	shapesize�	fillcolor�st)�selfr�r�2/usr/lib64/python3.8/turtledemo/sorting_animate.pyr	s
zBlock.__init__cCs|�d�dS)NZred�r�r
rrr�glowsz
Block.glowcCs|�d�dS)Nrrrrrr�unglow"szBlock.unglowcCsd�|j�S)NzBlock size: {0})�formatrrrrr�__repr__%szBlock.__repr__N)�__name__�
__module__�__qualname__r	rrrrrrrrsrc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�ShelfcCs||_d|_dS)Nij���)�y�x)r
rrrrr	+szShelf.__init__cCsP|��\}}}|dd}|�|j|�|�|jdt|��|�|�dS)Nr��")r
�setyr�setxr�len�append)r
�d�width�_�y_offsetrrr�push0s
z
Shelf.pushcCs0||d�D]}|��\}}|�|d�qdS�Nr��posr�r
�i�bZxposr$rrr�_close_gap_from_i8szShelf._close_gap_from_icCs0||d�D]}|��\}}|�|d�qdSr'r(r*rrr�_open_gap_from_i=szShelf._open_gap_from_icCs,t�||�}|��|�d�|�|�|S)N��)�list�poprrr-)r
�keyr,rrrr1Bs


z	Shelf.popcCsb|�|�t�|||�|�|jd|�|��\}}}|dd}|�|j|�|��dS)Nrrr)	r.r0�insertrrr
rrr)r
r2r,r#r$r%rrrr3Is
zShelf.insertN)	rrrr	r&r-r.r1r3rrrrr)srcCs\t|�}td|�D]D}|}|dkrD||j||djkrD|d}q|�||�|��qdS)N�r�r �rangerr3r1)�shelf�lengthr+Zholerrr�isortSs 
r9cCsjt|�}td|d�D]N}|}t|d|�D]}||j||jkr,|}q,||kr|�||�|��qdS)Nrr4r5)r7r8�jZiminr+rrr�ssort\sr;cCsn||}|�||�|��|}t||�D].}||j|jkr(|�||�|��|d}q(|�||�|��|S�Nr4)r3r1r6r)r7�left�right�pivot_indexZpivotZstore_indexr+rrr�	partitionfs
r@cCs>||kr:|}t||||�}t|||d�t||d|�dSr<)r@�qsort)r7r=r>r?Zpivot_new_indexrrrrAqs
rAcCs�t�t�ttd��}t�|�t|�D]@\}}t|tt��D](}t|j	|dkr@t�
|t�|��q@q*tt
�ttdd�t�dS)N�
r4��line)�disable_keys�clearr0r6�randomZshuffle�	enumerater �srr3r1�	show_text�
instructions1�
instructions2�enable_keys)�targetr+�tr:rrr�	randomizexs
rPcCs(d|}tdd|�t|ddd�dS)Nrri����center)ZCourier�Zbold)ZalignZfont)Zgoto�write)�textrDrrrrJ�srJcCs@t�t�td�tt�t�tt�ttdd�t�dS)NzSelection Sortr4rC)rErFrJr;rIrKrLrMrrrr�start_ssort�srUcCs@t�t�td�tt�t�tt�ttdd�t�dS)NzInsertion Sortr4rC)rErFrJr9rIrKrLrMrrrr�start_isort�srVcCsLt�t�td�ttdtt�d�t�tt�ttdd�t�dS)NZ	Quicksortrr4rC)	rErFrJrArIr rKrLrMrrrr�start_qsort�srWcCs(td�ad}|D]}t�t|��qdS)Ni8���)
�r��	r4�rB���)rrIr&r)Zvalsr+rrr�
init_shelf�sr_cCs,tdd�tdd�tdd�tdd�dS)NrIr+�q�r)�onkeyrrrrrE�s


rEcCs6ttd�ttd�ttd�ttd�ttd�dS)Nr+rIr`raZspace)rbrVrUrWrPZbyerrrrrM�s




rMcCs@t���t�t�t�tt�ttdd�t�t	�dS)Nr4rCZ	EVENTLOOP)
Z	getscreenZclearscreenZhtZpenupr_rJrKrLrMZlistenrrrr�main�s
rczApress i for insertion sort, s for selection sort, q for quicksortz spacebar to quit, r to randomize�__main__)r)ZturtlerGrrr0rr9r;r@rArPrJrUrVrWr_rErMrcrKrLr�msgZmainlooprrrr�<module>s**	





PK�Q�Z��u��.__pycache__/minimal_hanoi.cpython-38.opt-2.pycnu�[���U

e5d�@s`ddlTGdd�de�ZGdd�de�Zdd�Zdd	�Zd
d�Zedkr\e�Z	e
e	�e�d
S)�)�*c@seZdZdd�ZdS)�DisccCsPtj|ddd�|��|�d|dd�|�|ddd|d�|��dS)	NZsquareF)�shapeZvisibleg�?�g@r�)�Turtle�__init__ZpuZ	shapesizeZ	fillcolor�st)�self�n�r�0/usr/lib64/python3.8/turtledemo/minimal_hanoi.pyrs
z
Disc.__init__N)�__name__�
__module__�__qualname__rrrrr
rsrc@s$eZdZdd�Zdd�Zdd�ZdS)�TowercCs
||_dS)N)�x)r
rrrr
r szTower.__init__cCs0|�|j�|�ddt|��|�|�dS)Nij����")Zsetxr�sety�len�append�r
�drrr
�push#sz
Tower.pushcCst�|�}|�d�|S)N�)�list�poprrrrr
r's

z	Tower.popN)rrrrrrrrrr
rsrcCs>|dkr:t|d|||�|�|���t|d|||�dS)Nrr)�hanoirr)rZfrom_Zwith_Zto_rrr
r,srcCsJtdd�t�z tdttt�tdddd�Wntk
rDYnXdS)N�space�zpress STOP button to exit�center�ZCourier�Zbold�ZalignZfont)�onkey�clearr�t1�t2�t3�writeZ
Terminatorrrrr
�play2s
�
r*cCspt�t�tdd�td�atd�atd�atddd�D]}t�t	|��q:t
ddd	d
�ttd�t
�dS)
Nri���i����r���zpress spacebar to start gamer r!r#rZ	EVENTLOOP)ZhtZpenupZgotorr&r'r(�rangerrr)r$r*Zlisten)�irrr
�main<s
�
r/�__main__N)Zturtlerrrrrr*r/r�msg�printZmainlooprrrr
�<module>s
PK�Q�Zh>�7�
�
0__pycache__/planet_and_moon.cpython-38.opt-1.pycnu�[���U

e5d�@s`dZddlmZmZmZmZdZGdd�de�Z	Gdd�de�Z
dd	�Zed
kr\e�e�dS)a�       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.

�)�Shape�Turtle�mainloop�Vec2D�c@s$eZdZdd�Zdd�Zdd�ZdS)�GravSyscCsg|_d|_d|_dS)Nrg{�G�z�?)�planets�t�dt)�self�r�2/usr/lib64/python3.8/turtledemo/planet_and_moon.py�__init__szGravSys.__init__cCs|jD]}|��qdS)N)r�init)r�prrr
rs
zGravSys.initcCs6td�D](}|j|j7_|jD]}|��q"qdS)Ni')�ranger	r
r�step)r�irrrr
�start s
z
GravSys.startN)�__name__�
__module__�__qualname__rrrrrrr
rsrc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�StarcCsTtj||d�|��||_|�|�||_|j�|�||_|�	d�|�
�dS)N)�shape�user)rrZpenup�m�setpos�vr�append�gravSysZ
resizemodeZpendown)rr�xrrrrrr
r's

z
Star.__init__cCs,|jj}|��|_|jd||j|_dS)N��?)rr
�acc�ar�rr
rrr
r1s
z	Star.initcCsRtdd�}|jjD]:}||kr|��|��}|t|jt|�d|7}q|S)Nr�)�Vecrr�pos�Gr�abs)rr#�planetrrrr
r"5s
 zStar.acccCsj|jj}|�|��||j�|jj�|�dkrJ|�|�|jjd��|�	�|_
|j||j
|_dS)Nr)rr
rr'rr�indexZ
setheadingZtowardsr"r#r$rrr
r<s
z	Star.stepN)rrrrrr"rrrrr
r&s
rcCs|t�}|��|���dd�|��|��|�d�|�d�|��|�	dd�|�
�|��}|��|�	dd�|�
�|��}td�}|�
|d�|�
|d�|���d|�|���d	d�t�}td
tdd�tdd�|d�}|�d
�|�d�|��tdtdd�tdd�|d�}|�d�|�d�td	tdd�tdd�|d�}|�d�|�d�|��|��dS)Nr��Z�ZcompoundZorangeZbluer*�i@Bg��circleZyellowg������?i�0����Zgreeng�������?��i'r!zDone!)r�resetZ	getscreenZtracerZhtZpu�fd�ltZ
begin_polyr0Zend_polyZget_polyrZaddcomponentZregister_shaperrr&ZcolorZ	shapesizeZpencolorrr)�sZm1Zm2ZplanetshapeZgsZsunZearthZmoonrrr
�mainFsD







r8�__main__N)
�__doc__Zturtlerrrrr&r(�objectrrr8rrrrr
�<module>s 'PK�Q�Z;���0__pycache__/sorting_animate.cpython-38.opt-1.pycnu�[���U

��.e��@s�dZddlTddlZGdd�de�ZGdd�de�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zd%dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"Zd#Zed$kr�e�Ze�dS)&a�

         sorting_animation.py

A minimal sorting algorithm animation:
Sorts a shelf of 10 blocks using insertion
sort, selection sort and quicksort.

Shelfs are implemented using builtin lists.

Blocks are turtles with shape "square", but
stretched to rectangles by shapesize()
 ---------------------------------------
       To exit press space button
 ---------------------------------------
�)�*Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�BlockcCsF||_tj|ddd�|��|�|ddd�|�d�|��dS)NZsquareF)�shapeZvisibleg�?��black)�size�Turtle�__init__Zpu�	shapesize�	fillcolor�st)�selfr�r�2/usr/lib64/python3.8/turtledemo/sorting_animate.pyr	s
zBlock.__init__cCs|�d�dS)NZred�r�r
rrr�glowsz
Block.glowcCs|�d�dS)Nrrrrrr�unglow"szBlock.unglowcCsd�|j�S)NzBlock size: {0})�formatrrrrr�__repr__%szBlock.__repr__N)�__name__�
__module__�__qualname__r	rrrrrrrrsrc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�ShelfcCs||_d|_dS)z.create a shelf. y is y-position of first blockij���N)�y�x)r
rrrrr	+szShelf.__init__cCsP|��\}}}|dd}|�|j|�|�|jdt|��|�|�dS)Nr��")r
�setyr�setxr�len�append)r
�d�width�_�y_offsetrrr�push0s
z
Shelf.pushcCs0||d�D]}|��\}}|�|d�qdS�Nr��posr�r
�i�bZxposr$rrr�_close_gap_from_i8szShelf._close_gap_from_icCs0||d�D]}|��\}}|�|d�qdSr'r(r*rrr�_open_gap_from_i=szShelf._open_gap_from_icCs,t�||�}|��|�d�|�|�|S)N��)�list�poprrr-)r
�keyr,rrrr1Bs


z	Shelf.popcCsb|�|�t�|||�|�|jd|�|��\}}}|dd}|�|j|�|��dS)Nrrr)	r.r0�insertrrr
rrr)r
r2r,r#r$r%rrrr3Is
zShelf.insertN)	rrrr	r&r-r.r1r3rrrrr)srcCs\t|�}td|�D]D}|}|dkrD||j||djkrD|d}q|�||�|��qdS)N�r�r �rangerr3r1)�shelf�lengthr+Zholerrr�isortSs 
r9cCsjt|�}td|d�D]N}|}t|d|�D]}||j||jkr,|}q,||kr|�||�|��qdS)Nrr4r5)r7r8�jZiminr+rrr�ssort\sr;cCsn||}|�||�|��|}t||�D].}||j|jkr(|�||�|��|d}q(|�||�|��|S�Nr4)r3r1r6r)r7�left�right�pivot_indexZpivotZstore_indexr+rrr�	partitionfs
r@cCs>||kr:|}t||||�}t|||d�t||d|�dSr<)r@�qsort)r7r=r>r?Zpivot_new_indexrrrrAqs
rAcCs�t�t�ttd��}t�|�t|�D]@\}}t|tt��D](}t|j	|dkr@t�
|t�|��q@q*tt
�ttdd�t�dS)N�
r4��line)�disable_keys�clearr0r6�randomZshuffle�	enumerater �srr3r1�	show_text�
instructions1�
instructions2�enable_keys)�targetr+�tr:rrr�	randomizexs
rPcCs(d|}tdd|�t|ddd�dS)Nrri����center)ZCourier�Zbold)ZalignZfont)Zgoto�write)�textrDrrrrJ�srJcCs@t�t�td�tt�t�tt�ttdd�t�dS)NzSelection Sortr4rC)rErFrJr;rIrKrLrMrrrr�start_ssort�srUcCs@t�t�td�tt�t�tt�ttdd�t�dS)NzInsertion Sortr4rC)rErFrJr9rIrKrLrMrrrr�start_isort�srVcCsLt�t�td�ttdtt�d�t�tt�ttdd�t�dS)NZ	Quicksortrr4rC)	rErFrJrArIr rKrLrMrrrr�start_qsort�srWcCs(td�ad}|D]}t�t|��qdS)Ni8���)
�r��	r4�rB���)rrIr&r)Zvalsr+rrr�
init_shelf�sr_cCs,tdd�tdd�tdd�tdd�dS)NrIr+�q�r)�onkeyrrrrrE�s


rEcCs6ttd�ttd�ttd�ttd�ttd�dS)Nr+rIr`raZspace)rbrVrUrWrPZbyerrrrrM�s




rMcCs@t���t�t�t�tt�ttdd�t�t	�dS)Nr4rCZ	EVENTLOOP)
Z	getscreenZclearscreenZhtZpenupr_rJrKrLrMZlistenrrrr�main�s
rczApress i for insertion sort, s for selection sort, q for quicksortz spacebar to quit, r to randomize�__main__)r)�__doc__ZturtlerGrrr0rr9r;r@rArPrJrUrVrWr_rErMrcrKrLr�msgZmainlooprrrr�<module>s,*	





PK�Q�Z���.__pycache__/minimal_hanoi.cpython-38.opt-1.pycnu�[���U

e5d�@sddZddlTGdd�de�ZGdd�de�Zdd�Zd	d
�Zdd�Ze	d
kr`e�Z
ee
�e�dS)a�       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
 ---------------------------------------
�)�*c@seZdZdd�ZdS)�DisccCsPtj|ddd�|��|�d|dd�|�|ddd|d�|��dS)	NZsquareF)�shapeZvisibleg�?�g@r�)�Turtle�__init__ZpuZ	shapesizeZ	fillcolor�st)�self�n�r�0/usr/lib64/python3.8/turtledemo/minimal_hanoi.pyrs
z
Disc.__init__N)�__name__�
__module__�__qualname__rrrrr
rsrc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Towerz-Hanoi tower, a subclass of built-in type listcCs
||_dS)z-create an empty tower. x is x-position of pegN)�x)r
rrrr
r szTower.__init__cCs0|�|j�|�ddt|��|�|�dS)Nij����")Zsetxr�sety�len�append�r
�drrr
�push#sz
Tower.pushcCst�|�}|�d�|S)N�)�list�poprrrrr
r's

z	Tower.popN)rrr�__doc__rrrrrrr
rsrcCs>|dkr:t|d|||�|�|���t|d|||�dS)Nrr)�hanoirr)rZfrom_Zwith_Zto_rrr
r,srcCsJtdd�t�z tdttt�tdddd�Wntk
rDYnXdS)N�space�zpress STOP button to exit�center�ZCourier�Zbold�ZalignZfont)�onkey�clearr�t1�t2�t3�writeZ
Terminatorrrrr
�play2s
�
r+cCspt�t�tdd�td�atd�atd�atddd�D]}t�t	|��q:t
ddd	d
�ttd�t
�dS)
Nri���i����r ���zpress spacebar to start gamer!r"r$rZ	EVENTLOOP)ZhtZpenupZgotorr'r(r)�rangerrr*r%r+Zlisten)�irrr
�main<s
�
r0�__main__N)
rZturtlerrrrrr+r0r�msg�printZmainlooprrrr
�<module>s
PK�Q�Z���(__pycache__/minimal_hanoi.cpython-38.pycnu�[���U

e5d�@sddZddlTGdd�de�ZGdd�de�Zdd�Zd	d
�Zdd�Ze	d
kr`e�Z
ee
�e�dS)a�       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
 ---------------------------------------
�)�*c@seZdZdd�ZdS)�DisccCsPtj|ddd�|��|�d|dd�|�|ddd|d�|��dS)	NZsquareF)�shapeZvisibleg�?�g@r�)�Turtle�__init__ZpuZ	shapesizeZ	fillcolor�st)�self�n�r�0/usr/lib64/python3.8/turtledemo/minimal_hanoi.pyrs
z
Disc.__init__N)�__name__�
__module__�__qualname__rrrrr
rsrc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Towerz-Hanoi tower, a subclass of built-in type listcCs
||_dS)z-create an empty tower. x is x-position of pegN)�x)r
rrrr
r szTower.__init__cCs0|�|j�|�ddt|��|�|�dS)Nij����")Zsetxr�sety�len�append�r
�drrr
�push#sz
Tower.pushcCst�|�}|�d�|S)N�)�list�poprrrrr
r's

z	Tower.popN)rrr�__doc__rrrrrrr
rsrcCs>|dkr:t|d|||�|�|���t|d|||�dS)Nrr)�hanoirr)rZfrom_Zwith_Zto_rrr
r,srcCsJtdd�t�z tdttt�tdddd�Wntk
rDYnXdS)N�space�zpress STOP button to exit�center�ZCourier�Zbold�ZalignZfont)�onkey�clearr�t1�t2�t3�writeZ
Terminatorrrrr
�play2s
�
r+cCspt�t�tdd�td�atd�atd�atddd�D]}t�t	|��q:t
ddd	d
�ttd�t
�dS)
Nri���i����r ���zpress spacebar to start gamer!r"r$rZ	EVENTLOOP)ZhtZpenupZgotorr'r(r)�rangerrr*r%r+Zlisten)�irrr
�main<s
�
r0�__main__N)
rZturtlerrrrrr+r0r�msg�printZmainlooprrrr
�<module>s
PK�Q�Z�&Hqq&__pycache__/round_dance.cpython-38.pycnu�[���U

e5d�@s8dZddlTdd�Zdd�Zedkr4ee��e�dS)	aF      turtle-example-suite:

         tdemo_round_dance.py

(Needs version 1.1 of the turtle module that
comes with Python 3.1)

Dancing turtles have a compound shape
consisting of a series of triangles of
decreasing size.

Turtles march along a circle while rotating
pairwise in opposite direction, with one
exception. Does that breaking of symmetry
enhance the attractiveness of the example?

Press any key to stop the animation.

Technically: demonstrates use of compound
shapes, transformation of shapes as well as
cloning turtles. The animation is
controlled through update().
�)�*cCsdadS)NF)�running�rr�./usr/lib64/python3.8/turtledemo/round_dance.py�stopsrcCs�t�td�td�td�d}d}d}d}td�}td	�D]D}t|�t�}||9}||9}t|�|�	||d
d|fd�q>t
d|�td�td�t�td
d�g}td�D]:}t
d�td�td�t�|dd
kr�|�t��q�t�datt�t�d}t�r�d}	|D]6}
|
�
d�|
�d�|
�|	�|	d
k�rPdnd}	�q |dk�rztd�t|�|d9}t��qdS)NZgray10FZtriangleg}�R��c�?g���y!"@��Zcompound�
g�?ZblackZmultitriri8����������T�g�G�z�?zDONE!)ZclearscreenZbgcolorZtracer�shapeZShape�rangeZ	shapesizeZ
get_shapepolyZtiltZaddcomponentZregister_shapeZpuZsetpos�fd�lt�update�appendZclone�homerZ
onkeypressrZlisten�right)�fZphi�s�cZsh�i�pZdancersZcsZtaZdancerrrr�mains^







r�__main__N)�__doc__Zturtlerr�__name__�printZmainlooprrrr�<module>s5
PK�Q�ZOw�f��&__pycache__/chaos.cpython-38.opt-2.pycnu�[���U

e5d��@sdddlTdZdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	e
dkr`e	�e�dS)�)�*�PcCsd|d|S)N�333333@����xrr�(/usr/lib64/python3.8/turtledemo/chaos.py�fsr
cCsd||dS)Nr�rrrrr	�gsrcCsd|d||S)Nrrrrrr	�hsr
cCst�t||�dS�N)Zpenup�goto)r�yrrr	�jumptosrcCst||�t�t||�dSr)r�pendownr)Zx1Zy1Zx2Zy2rrr	�lines
rcCs$tddtdd�tdddd�dS)N���rr皙������皙�����?)r�Nrrrr	�coosyssrcCsTt|�|}td|�t�td�tt�D]"}||�}t|d|�td�q,dS)Nr�r)Zpencolorrr�dot�rangerr)Zfun�startZcolorr�irrr	�plot s
rcCsxt�tddtdd�td�t�t�ttdd�ttdd�tt	dd	�t
d
�D]}td|dtdd�qXdS)
Ng�rrrrgffffff�?ZblueZgreenZred�dg�?zDone!)�resetZsetworldcoordinatesrZspeedZ
hideturtlerrr
rr
r)�srrr	�main+sr"�__main__N)Zturtlerr
rr
rrrrr"�__name__Zmainlooprrrr	�<module>sPK�Q�Z�B��  -__pycache__/two_canvases.cpython-38.opt-2.pycnu�[���U

e5d_�@s6ddlmZmZmZdd�Zedkr2e�e��dS)�)�TurtleScreen�	RawTurtle�TKc	CsNt��}tj|dddd�}tj|dddd�}|��|��t|�}|�ddd�t|�}|�ddd�t|�}t|�}|�dd	�|�d
�|�dd�|�d
�||fD]}|�	d
�|�
d�q�|�
d�||fD]}|��q�td�D]&}||fD]}|�
d�|�
d�q�q�||fD]*}|��|�
d�|��|�d��qdS)Ni,��z#ddffff)�widthZheightZbgz#ffeeee�333333�?�Zred)rrr�Zblue)rrr�turtle�$���2�H�6Z	EVENTLOOP)rZTkZCanvasZpackrZbgcolorrZcolorr�shape�ltZ
begin_fill�range�fdZend_fillZpuZbk)	�rootZcv1Zcv2�s1�s2�p�q�t�i�r�//usr/lib64/python3.8/turtledemo/two_canvases.py�mains>






r�__main__N)r
rrrr�__name__Zmainlooprrrr�<module>	s)PK�Q�Z��<��+__pycache__/bytedesign.cpython-38.opt-1.pycnu�[���U

e5d��@sXdZddlmZmZddlmZGdd�de�Zdd�Ze	dkrTe�Z
ee
�e�d	S)
a�      turtle-example-suite:

        tdemo_bytedesign.py

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

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.
�)�Turtle�mainloop)�perf_counterc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�DesignercCs�|��td�D]J}|�d|�|��|�|��|�|��|�d|�|�d�q|��|�|�|�d�|�d|�|�d�|��|�	d|d|�|�
��d	�dS)
N�g�����)P@�H�$g�8@���.g������a@T)�up�range�forward�down�wheel�position�backward�right�goto�centerpiece�	getscreen�tracer)�selfZhomePos�scale�i�r�-/usr/lib64/python3.8/turtledemo/bytedesign.py�design s 


zDesigner.designcCs�|�d�td�D]}|�||�q|��|�d�td�D]}|�||�q>|�d�td�D]:}|��|�d�|�d|�|��|�d|�qb|�d�|�	��
�dS)N�6�rrr�)rr�	pentpiecer�left�tripiecer
rrr�update)r�initposrrrrrr2s 




zDesigner.wheelcCs�|��}|��|�d|�|�d||�|��|�|�|�|�|��|�d|�|�d||�|��|�|�|�|�|�d�|�	��
�dS)Ng@g�?@r)�headingrr�tripolyrrr�
setheading�tripolylr!rr#)rr$r�oldhrrrr"Ds




zDesigner.tripiececCs�|��}|��|�d|�|��td�D]}|�d|�|�d�q.|�d|d|�|��|�|�|�|�|�d|�|��td�D]}|�d|�|�d�q�|�	d|d|�|��|�|�|�|�|�
d�|����dS)N�r�r�K)
r%rr
rrr�pentrrr'�pentlr!rr#)rr$rr)rrrrr Us,




zDesigner.pentpiececCs>|d|krdS|�|�|�|�|�|d|||�dS�N�gR���Q�?)r
r!r.�r�sideZangrrrrr.ms


zDesigner.pentlcCs>|d|krdS|�|�|�|�|�|d|||�dSr/)r
rr-r1rrrr-ss


zDesigner.pentrcCsh|d|krdS|�|�|�d�|�|d�|�d�|�|d�|�d�|�|d|�dS�Nr�og{�G�z�?g�������?�g�?)r
rr&�rr2rrrrr&ys



zDesigner.tripolyrcCsh|d|krdS|�|�|�d�|�|d�|�d�|�|d�|�d�|�|d|�dSr3)r
r!r(r6rrrr(�s



zDesigner.tripolylcCs>|�|�|�|�|d|kr$dS|�|d|||�dS)Ng@g333333�?)r
r!r)r�s�arrrrr�s


zDesigner.centerpieceN)�__name__�
__module__�__qualname__rrr"r r.r-r&r(rrrrrrs

rcCs\t�}|�d�|��|���d�|���d�t�}|�|��d�t�}d||S)Nrr0zruntime: %.2f sec.)	rZspeedZ
hideturtlerZdelayr�clockrr)�tZatZetrrr�main�s
r>�__main__N)�__doc__Zturtlerr�timerr<rr>r9�msg�printrrrr�<module>suPK�Q�Z&��nn%__pycache__/tree.cpython-38.opt-2.pycnu�[���U

e5dx�@sTddlmZmZddlmZdd�Zdd�Zdd�Ze	d	krPe�Z
ee
�e�d
S)�)�Turtle�mainloop)�perf_counterccsr|dkrng}|D]>}|�|�|��}|�|�|�|�|�|�|�|�qt|||||�D]
}dVqbdS)N�)�forwardZclone�left�right�append�tree)Zplist�l�a�fZlst�p�q�x�r�'/usr/lib64/python3.8/turtledemo/tree.pyr
s



r
cCstt�}|�d�|��|�d�|���dd�|�d�|��|�d�|�	�t
|gddd�}|D]}qjdS)Nr��Zi.������Agffffff�?)rZ
setundobufferZ
hideturtleZspeedZ	getscreenZtracerrZpenuprZpendownr
)r�trrrr�maketree's



rcCst�}t�t�}d||S)Nzdone: %.2f sec.)�clockr)r�brrr�main5sr�__main__N)Zturtlerr�timerrr
rr�__name__�msg�printrrrr�<module>sPK�Q�Z�%m��
�
&__pycache__/lindenmayer.cpython-38.pycnu�[���U

e5d�	�@sDdZddlTdd�Zdd�Zdd�Zed	kr@e�Zee�e�d
S)a�       turtle-example-suite:

        xtx_lindenmayer_indian.py

Each morning women in Tamil Nadu, in southern
India, place designs, created by using rice
flour and known as kolam on the thresholds of
their homes.

These can be described by Lindenmayer systems,
which can easily be implemented with turtle
graphics and Python.

Two examples are shown here:
(1) the snake kolam
(2) anklets of Krishna

Taken from Marcia Ascher: Mathematics
Elsewhere, An Exploration of Ideas Across
Cultures

�)�*cCs4t|�D]&}d}|D]}||�||�}q|}q|S)N�)�range�get)�seqZreplacementRules�n�iZnewseqZelement�r	�./usr/lib64/python3.8/turtledemo/lindenmayer.py�replacesrc
CsR|D]H}z||�Wqtk
rJzt|||�WnYnXYqXqdS)N)�	TypeError�draw)ZcommandsZrules�br	r	r
r
&sr
cCsdd�}dd�}dd�}|||dd�}d	d
i}d}t||d�}t�td�td
d�t�t�td�t�t||�ddl	m
}|d�dd�}dd�}	dd�}
||	|
d�}ddd�}d}
t�td�tdd�t�td�t|
|d�}t||�td
�dS)NcSstd�dS�N�-)�rightr	r	r	r
�r7szmain.<locals>.rcSstd�dSr)�leftr	r	r	r
�l:szmain.<locals>.lcSstd�dS)Ng@)�forwardr	r	r	r
�f=szmain.<locals>.fzf+f+f--f--f+f+f)�-�+rrrzb+f+b--f--b+f+bz
b--f--b--f��r��)�sleepcSstd�tdd�dS)NZred�
�Z)�color�circler	r	r	r
�AVszmain.<locals>.AcSs>ddlm}td�d|d�}t|�t|d�t|�dS)Nr)�sqrtZblack��i)Zmathr"rrr )r"rr	r	r
�BZs
zmain.<locals>.BcSstd�td�dS)NZgreenr)rrr	r	r	r
�Fbszmain.<locals>.F)�arrZafbfaZ	afbfbfbfa)r'rZfbfbfbfbrzDone!)r�resetZspeedZtracerZhtZupZbackwardZdownr
�timerr)rrrZsnake_rulesZsnake_replacementRulesZsnake_startZdrawingrr!r%r&Z
krishna_rulesZkrishna_replacementRulesZ
krishna_startr	r	r
�main1s@




r*�__main__N)	�__doc__Zturtlerr
r*�__name__�msg�printZmainloopr	r	r	r
�<module>sCPK�Q�Z��eĨ�(__pycache__/rosette.cpython-38.opt-1.pycnu�[���U

e5dQ�@sXdZddlmZmZmZddlmZmZdd�Z	dd�Z
edkrTe
�Ze
e�e�d	S)
aF      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().
�)�Screen�Turtle�mainloop)�perf_counter�sleepcCs�|g}td|�D](}|��}|�d|�|�|�|}qt|�D]P}t|d|�|d}|D].}|�d|�|�d|d|�|�|�qbqBdS)N�g�v@g@gffffff�?r)�rangeZcloneZrt�append�abs�pencolor�fd)�p�neZszZ
turtlelist�i�q�c�t�r�*/usr/lib64/python3.8/turtledemo/rosette.py�mn_ecks
rcCs�t�}|�d�t�}|�d�|��|�d�|�d�|�dd�t�}t	|dd�t�}||}t
d�t�}tdd	�|��D��r�|��D]}|�
�q�qvt�}d
|||S)NZblackrZred��$�rcss|]}|��VqdS)N)Zundobufferentries)�.0rrrr�	<genexpr>7szmain.<locals>.<genexpr>zruntime: %.3f sec)rZbgcolorrZspeedZ
hideturtlerZpensizeZtracer�clockrr�anyZturtlesZundo)�sr
ZatZetZz1rrrr�main$s&



r�__main__N)�__doc__Zturtlerrr�timerrrrr�__name__�msg�printrrrr�<module>sPK�Q�Z�d?;��'__pycache__/forest.cpython-38.opt-1.pycnu�[���U

e5d��@s�dZddlmZmZmZmZddlmZddlm	Z
dd�Zdd�Zd	d
�Z
dd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zedkr�e�e�dS)a4     turtlegraphics-example-suite:

             tdemo_forest.py

Displays a 'forest' of 3 breadth-first-trees
similar to the one in tree.
For further remarks see tree.py

This example is a 'breadth-first'-rewrite of
a Logo program written by Erich Neuwirth. See
http://homepage.univie.ac.at/erich.neuwirth/
�)�Turtle�	colormode�tracer�mainloop��	randrange)�perf_countercCst||d�S)N�r)�n�r�)/usr/lib64/python3.8/turtledemo/forest.py�	symRandomsr
cs��fdd�|D�S)Ncs,g|]$\}}|t��|dt��f�qS)g)\��(�?)r
)�.0�angle�
sizefactor��	angledist�sizedistrr�
<listcomp>s�
�zrandomize.<locals>.<listcomp>r)�
branchlistrrrrr�	randomizes�rcCs2t|�D]$}|�t|��|�d||�qdS)Ng�?)�range�leftr
Zforward)�tZdistance�partsr�irrr�randomfdsr�
�ccs�|dkr�g}g}tt||��D]�\}	}
|	�||�|	�ddd|td�dd|td�d�|	��t|	|||�dV|
D]<\}}|	�|�|�|	�	��|�t
|
||��|	�|�q�qt||||d||||�D]
}
dVq�dS)Nr����r	)
�list�zipZpensizeZpencolorr
�pendownrr�appendZcloner�right�tree)Ztlist�size�levelZwidthfactorZbranchlistsrrZlstZbrsrrrr�xrrrr(s,�
�r(cCsLtd�|��|�d�|��|�d�|��|�||�|��dS)Nrr�Z)r�resetZspeed�
hideturtlerZpenupZsetposr%)rr+�yrrr�start7s

r0cCs2|��t|dd�t|gd|ddddgg�}|S)N�i0����P皙�����?��-g�G�z�?)r��������?�����g���Q��?�r.r0r(�r*Zpenrrrr�doit1Asr;cCs0|��t|dd�t|gd|dddgg�}|S)Niy���i~����xr3r4r7r9r:rrr�doit2Gsr=cCs2|��t|dd�t|gd|ddddgg�}|S)N�i�����dr3)r5gffffff�?)rg
ףp=
�?)r8r6r9r:rrr�doit3Msr@cCs�t�}|��tdd�tdtdd��}tdtdd��}tdtdd��}t�}d}|||fD]&}z|��Wq\|d7}Yq\Xq\|dkrNq�qNtdd	�t�}d
||S)N�Kr�r	)Zundobuffersize�r�rzruntime: %.2f sec.)rZhtrr;r=r@�clock�__next__)�p�u�sr�aZdone�brrr�mainTs$

rL�__main__N)rr)�__doc__ZturtlerrrrZrandomr�timerrEr
rrr(r0r;r=r@rL�__name__rrrr�<module>s

PK�Q�Z�9�lZ3Z3#__pycache__/__main__.cpython-38.pycnu�[���U

��.e�7�@sdZddlZddlZddlTddlmZmZddlmZddl	m
Z
ddlmZddl
Z
ej�ej�e��ZejdkZd	Zd
ZdZdZd
ZddefZdZdddgZdZdZdddddddddddgZ dd �Z!d!efd"efd#e
jffZ"Gd$d%�d%e#�Z$d&d'�Z%e&d(k�re%�dS))a�
  ----------------------------------------------
      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!

  The demo viewer windows can be resized. The divider between text
  and canvas can be moved by grabbing it with the mouse. The text font
  size can be changed from the menu and with Control/Command '-'/'+'.
  It can also be changed on most systems with Control-mousewheel
  when the mouse is over the text.

  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, such as clock.py are those which run EVENTDRIVEN.

      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

   - Place the file in the same directory as turtledemo/__main__.py
     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 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 open

    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.)
�N)�*)�ColorDelegator�color_config)�
Percolator)�	view_text)�__doc__�darwin������Arial�)rrZboldzLucida Console�
�normal��d��	�������cCsdd�t�t�D�S)NcSs.g|]&}|�d�r|ddkr|dd��qS)z.pyr�_N���)�endswith)�.0�entry�r"�+/usr/lib64/python3.8/turtledemo/__main__.py�
<listcomp>ts
�z%getExampleEntries.<locals>.<listcomp>)�os�listdir�demo_dirr"r"r"r#�getExampleEntriesssr(zTurtledemo helpzAbout turtledemozAbout turtle modulec@s�eZdZd(dd�Zdd�Zdd�Zdd	�Zd
d�Zd)dd
�Zd*dd�Z	dd�Z
d+dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS),�
DemoWindowNc	CsJt�|_}t_|�d�|�d|j�trbddl}|j	ddddd�
t���ddg|j
|j
d	�|jdd
d�|jdd
d�|jd
dd
d
�|jddd
d
�|jddd
d
�t|tdd�|_|jj|�|j�ddd�|jj|�|j�ddd�|jj|�|j�ddd�|j|d<ttdtdd�}|�|�|��|�|�|��|jdddd�t|d
ddddtd�|_ t!|d t"d!d"|j#d#�|_$t!|d$t"d!d"|j%d#�|_&t!|d%t"d!d"|j'd#�|_(|j jd
ddd&d'�|j$jd
d
d(d)�|j&jd
dd(d)�|j(jd
dd(d)�t)|j*��+t,��d*|_-d*|_.|�r.|�/|�|�0t1t1t1d+d,�t2|_3dS)-NzPython turtle-graphics examplesZWM_DELETE_WINDOWrZ	osascriptz-ez tell application "System Events"z>set frontmost of the first process whose unix id is {} to truezend tell)�stderr�stdoutr	)�weight�Z)Zminsizer,r
r)�relief�borderwidthZExamples)�menu�label�	underlineZFontsizeZHelpr0r
z#ddd)�orientZ	sashwidthZ
sashrelief�bgrZnews)�rowZ
columnspan�stickyz --- z#ddf)r�r)Zheight�textr4�fontr/r.z START Zwhitez#fed)r8r9�fgZdisabledforeground�commandz STOP z CLEAR )rr
)r5�columnr6�padxZew)r5r<r6FzChoose example from menu�black)4ZTk�root�turtle�_root�titleZwm_protocol�_destroyr�
subprocess�run�formatr%�getpidZDEVNULLZgrid_rowconfigureZgrid_columnconfigure�MenuZRAISEDZmBarZadd_cascade�makeLoadDemoMenu�makeFontMenu�makeHelpMenuZPanedWindow�
HORIZONTALZSOLID�add�
makeTextFrame�makeGraphFrameZgridZLabelZRIDGE�
output_lblZButton�btnfont�	startDemo�	start_btn�stopIt�stop_btn�clearCanvas�	clear_btnrr8Zinsertfilterr�dirty�exitflag�loadfile�	configGUI�DISABLED�STARTUP�state)�self�filenamer?rDZpaner"r"r#�__init__�s�
������
�
����

�zDemoWindow.__init__cCsP|j��}|j��}|j�d|j||j�|j�d|j||j�dS)Ng�?)�_canvasZwinfo_widthZwinfo_heightZxview_moveto�	canvwidthZyview_moveto�
canvheight)r_�eventZcwidthZcheightr"r"r#�onResize�s

zDemoWindow.onResizecCs6t|�|_}t|ddddd�|_}t|�t|dd�|_}|j|d<|jt	t
d	�t|d
td�|_}|j
|d<|jttd	�|j|d<|j|d
<tt�|d<tr�dnd}|�d||j�|�d||j�|�d||j�|�d||j�|�d|j�|�d|j�|�d|j�|jt	tdd�|S)Nr8r
Znone�-)�namer=Zwrap�width�vbar)rhr;)�side�fill�hbar)rhr3ZyscrollcommandZxscrollcommandr9ZCommandZControlz
<%s-minus>z<%s-underscore>z
<%s-equal>z	<%s-plus>z<Control-MouseWheel>z<Control-Button-4>z<Control-Button-5>r	)rkrl�expand)ZFrame�
text_frameZTextr8rZ	ScrollbarrjZyviewZpackZLEFT�YrLrmZxviewZBOTTOM�X�set�tuple�txtfontrZbind_all�
decrease_size�
increase_size�bind�update_mousewheelZBOTH)r_r?ror8rjrmZshortcutr"r"r#rN�s2�



zDemoWindow.makeTextFramecCs�|tj_d|_d|_t�|dd|j|j�tj_|_}|��|j�	d|j
�d|jd<t��|_}tj
�||j�|j|_|gtj_|S)Ni�i iXz<Configure>rr/)r@Z_ScreenrArcrdZScrolledCanvasrbZ
adjustScrollsZ_rootwindowrwrfZScreen�screen�TurtleScreenra�scanvasZ	RawTurtleZscreens)r_r?ZcanvasZ_s_r"r"r#rO�s$�

zDemoWindow.makeGraphFramecCs(|td<tt�|jd<d||jd<dS)Nr	r9zFont size %dr8)rtrsr8rP)r_�sizer"r"r#�set_txtsize�szDemoWindow.set_txtsizecCs|�ttddt��dS�Nr	�break)r}�maxrt�MINIMUM_FONT_SIZE�r_Zdummyr"r"r#ru�szDemoWindow.decrease_sizecCs|�ttddt��dSr~)r}�minrt�MAXIMUM_FONT_SIZEr�r"r"r#rvszDemoWindow.increase_sizecCs$|jdktkr|��S|��SdS)Nr)Zdeltarrurv)r_rer"r"r#rxszDemoWindow.update_mousewheel��bluecCsh|jj||tkrdndd�|jj||tkr0dndd�|jj||tkrLdndd�|jj||d�dS)Nz#d00z#fca)r^r4)r8r:)rS�config�NORMALrUrWrP)r_�start�stop�clearZtxtZcolorr"r"r#r[s���zDemoWindow.configGUIcs:t|�}t�D]&}|f�fdd�	}|j|dt|d�q|S)Ncs��|�dS�N)rZ)r!�r_r"r#�loadsz)DemoWindow.makeLoadDemoMenu.<locals>.loadr�r1r2r9r;)rHr(�add_command�menufont)r_�masterr0r!r�r"r�r#rIs
�zDemoWindow.makeLoadDemoMenucsht|�}|jd�jtd�|jd�jtd�|��tD]*}|f�fdd�	}|jt|�dt|d�q8|S)NzDecrease (C-'-'))r1r;r9zIncrease (C-'+')cs��|�dSr�)r})r|r�r"r#�resize(sz'DemoWindow.makeFontMenu.<locals>.resizerr�)rHr�rur�rvZ
add_separator�
font_sizes�str)r_r�r0r|r�r"r�r#rJs
�
��zDemoWindow.makeFontMenucs<t|�}tD]*\}}||f�fdd�	}|j|t|d�q|S)Ncst�j||�dSr�)rr?)�
help_label�	help_filer�r"r#�show2sz%DemoWindow.makeHelpMenu.<locals>.show)r1r9r;)rH�help_entriesr�r�)r_r�r0r�r�r�r"r�r#rK.s
zDemoWindow.makeHelpMenucCs|jr|j��d|_dS�NF)rXryr�r�r"r"r#�
refreshCanvas7s
zDemoWindow.refreshCanvasc	Cs�|��dtj_d|}t|�tj||_t|jj	d��}|�
�}W5QRX|j�dd�|j�
d|�|j�|d�|�tttdd�t|_dS)	NFzturtledemo.�rz1.0�endz# - a Python turtle graphics examplezPress start button�red)rVr@rz�_RUNNING�
__import__�sys�modules�module�open�__file__�readr8�delete�insertr?rBr[r�r\�READYr^)r_r`�modname�f�charsr"r"r#rZ<s
�zDemoWindow.loadfilecCs�|��d|_dtj_|�tttdd�|j�	�|j�
d�t|_z$|j
��}|dkr`t|_nt|_Wn0tjk
r�|jdkr�YdSt|_d}YnX|jtkr�|�ttt|�n"|jtkr�d|_|�tttdd�dS)	NTzdemo running...r>ZstandardZ	EVENTLOOPzstopped!zuse mouse/keys or STOPr�)r�rXr@rzr�r[r\r�ryr��mode�RUNNINGr^r��main�EVENTDRIVEN�DONEZ
Terminatorr?rY)r_�resultr"r"r#rRKs<
�






�

�zDemoWindow.startDemocCs4|��|j�d�|jjdd�|�ttt�dS)N�allr�)Zcursor)r�ryZ_deleter{r�r[r�r\r�r"r"r#rVhszDemoWindow.clearCanvascCs2|jr&|��d|_|�tttdd�dtj_dS)NFzSTOPPED!r�)rYrVr[r�r\r@rzr�r�r"r"r#rTns
�zDemoWindow.stopItcCsdtj_|j��d|_dSr�)r@rzr�r?Zdestroyr�r"r"r#rCvs
zDemoWindow._destroy)N)N)N)r�r�)�__name__�
__module__�__qualname__rarfrNrOr}rurvrxr[rIrJrKr�rZrRrVrTrCr"r"r"r#r)s$
D


	
	r)cCst�}|j��dSr�)r)r?Zmainloop)Zdemor"r"r#r�|sr��__main__)'rr�r%ZtkinterZidlelib.colorizerrrZidlelib.percolatorrZidlelib.textviewrZ
turtledemoZabout_turtledemor@�path�dirname�abspathr�r'�platformrr]r�r�r�r�r�r�rQrtr�r�r�r(r��objectr)r�r�r"r"r"r#�<module>s>U


�~
PK�Q�ZCws_--"__pycache__/yinyang.cpython-38.pycnu�[���U

e5d4�@s4dZddlTdd�Zdd�Zedkr0e�e�dS)	z�       turtle-example-suite:

            tdemo_yinyang.py

Another drawing suitable as a beginner's
programming example.

The small circles are drawn by the circle
command.

�)�*cCs�td�td|�t�t|dd�t|d�td�t|dd�t�td�t�t|d�td�t	�t||�t�t|d�t�td�t�t
|d�t	�td�dS)N��blackg@��Zgffffff�?g333333�?)�widthZcolorZ
begin_fillZcircle�leftZend_fillZupZforward�rightZdownZbackward)ZradiusZcolor1Zcolor2�r
�*/usr/lib64/python3.8/turtledemo/yinyang.py�yins,


rcCs(t�tddd�tddd�t�dS)N��rZwhitezDone!)�resetrZhtr
r
r
r�main(s
r�__main__N)�__doc__Zturtlerr�__name__Zmainloopr
r
r
r�<module>sPK�Q�Z��춥
�
&__pycache__/clock.cpython-38.opt-1.pycnu�[���U

e5d��@s�dZddlTddlmZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zedkr�e
d�e�Zee�e�dS)z�       turtle-example-suite:

             tdemo_clock.py

Enhanced clock-program, showing date
and time
  ------------------------------------
   Press STOP to exit the program!
  ------------------------------------
�)�*)�datetimecCs(t�t|�t|�t|�t�dS)N)Zpenup�right�forward�leftZpendown)ZdistanzZwinkel�r�(/usr/lib64/python3.8/turtledemo/clock.py�jumps
r	cCsXt|d�td�t|d�td�t|�td�t|�td�t|d�dS)Ngffffff�?�Zg@�x)�fd�rt�lt)�laenge�spitzerrr�handsrcCs>t�t|d�t�t||�t�t�}t||�dS)Ng333333�?)�resetr	Z
begin_polyrZend_polyZget_polyZregister_shape)�namerrZ	hand_formrrr�make_hand_shape"s
rcCsft�td�td�D]J}t|�|ddkrFtd�t|d�ntd�t|�td�qdS)N��<�r���)rZpensize�ranger	r�dotr
)Zradius�irrr�	clockface+s
rcCs�td�tddd�tddd�tddd�td	�t�at�d�t�d
d�t�at�d�t�dd
�t�at�d�t�dd�tttfD]&}|�	d�|�
ddd�|�d�q�t�t�a
t
��t
��t
�d�dS)N�logo�second_hand�}r�minute_hand��	hour_handr
�Zgray20Zgray80Zblue1Zred1Zblue3Zred3�user�rr�U)�moderrZTurtler �shapeZcolorr"r$Z
resizemodeZ	shapesizeZspeedZht�writerZpuZbk)rrrr�setup8s.



r,cCsdddddddg}||��S)NZMondayZTuesdayZ	WednesdayZThursdayZFridayZSaturdayZSunday)Zweekday)�t�	wochentagrrrr.Ss�r.cCsDddddddddd	d
ddg}|j}||jd
}|j}d|||fS)NzJan.zFeb.zMar.zApr.ZMayZJuneZJulyzAug.zSep.zOct.zNov.zDec.r'z%s %d %d)ZyearZmonthZday)�zZmonat�j�mr-rrr�datumXs�r2cCs�t��}|j|jd}|j|d}|j|d}z�td�t��t�	�t�
d�tjt|�ddd�t�
d�tjt|�ddd�t�
d	�td
�t�d|�t�d|�t�d|�td
�ttd
�Wntk
r�YnXdS)Ng���ư>gN@F�A�center)ZCourier�Zbold)ZalignZfont�r(Tr��d)rZtoday�secondZmicrosecond�minuteZhour�tracerr+�clear�homer�writer.Zbackr2r Z
setheadingr"r$Zontimer�tickZ
Terminator)r-Zsekunder:Zstunderrrr?`s6

�

�
r?cCs td�t�td�t�dS)NFTZ	EVENTLOOP)r;r,r?rrrr�mainys
r@�__main__rN)r)�__doc__Zturtlerr	rrrr,r.r2r?r@�__name__r)�msg�printZmainlooprrrr�<module>s 

	
PK�Q�Z���+__pycache__/colormixer.cpython-38.opt-2.pycnu�[���U

e5d;�@sTddlmZmZmZGdd�de�Zdd�Zdd�ZedkrPe�Ze	e�e�d	S)
�)�Screen�Turtle�mainloopc@seZdZdd�Zdd�ZdS)�ColorTurtlecCs�t�|�|�d�|�d�|�ddd�|�d�dddg|_||_||j|<|�|j�|�	d�|�
d�|��|�|d�|�
�|�d�|��|�|�|�d	�|�|j�dS)
N�turtle�user���
r�Z�Zgray25)r�__init__�shapeZ
resizemodeZ	shapesizeZpensize�_color�xZcolorZspeed�left�pu�gotoZpd�setyZpencolorZondrag�shift��selfr�y�r�-/usr/lib64/python3.8/turtledemo/colormixer.pyr
s&









zColorTurtle.__init__cCs<|�tdt|d���|��|j|j<|�|j�t�dS)Nrr)r�max�min�ycorrrZ	fillcolor�
setbgcolorrrrrrszColorTurtle.shiftN)�__name__�
__module__�__qualname__r
rrrrrrsrcCst�t��t��t���dS)N)�screenZbgcolor�redr�green�bluerrrrr"srcCszt�at�d�t�dddd�tdd�atdd�atdd�at�t	�}|�
�|��|�dd	�|j
d
ddd
�dS)Nr���g333333ӿrg�������?g�?r�gffffff�?zDRAG!�center)ZArial�)ZboldZitalic)ZalignZfontZ	EVENTLOOP)rr"ZdelayZsetworldcoordinatesrr#r$r%rrZhtrr�write)�writerrrr�main%s



r,�__main__N)
rrrrrrr,r�msg�printrrrr�<module>sPK�Q�Z&Ta��)__pycache__/__init__.cpython-38.opt-1.pycnu�[���U

e5d:�@sdZdS)a3
    --------------------------------------
        About this viewer
    --------------------------------------

    Tiny demo viewer to view turtle graphics example scripts.

    Quickly and dirtyly assembled by Gregor Lingl.
    June, 2006

    For more information see: turtledemo - Help

    Have fun!
N)�__doc__�rr�+/usr/lib64/python3.8/turtledemo/__init__.py�<module>�PK�Q�Z}/��&__pycache__/clock.cpython-38.opt-2.pycnu�[���U

e5d��@s�ddlTddlmZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	dd�Z
edkr�ed�e
�Z
ee
�e�dS)�)�*)�datetimecCs(t�t|�t|�t|�t�dS)N)Zpenup�right�forward�leftZpendown)ZdistanzZwinkel�r�(/usr/lib64/python3.8/turtledemo/clock.py�jumps
r	cCsXt|d�td�t|d�td�t|�td�t|�td�t|d�dS)Ngffffff�?�Zg@�x)�fd�rt�lt)�laenge�spitzerrr�handsrcCs>t�t|d�t�t||�t�t�}t||�dS)Ng333333�?)�resetr	Z
begin_polyrZend_polyZget_polyZregister_shape)�namerrZ	hand_formrrr�make_hand_shape"s
rcCsft�td�td�D]J}t|�|ddkrFtd�t|d�ntd�t|�td�qdS)N��<�r���)rZpensize�ranger	r�dotr
)Zradius�irrr�	clockface+s
rcCs�td�tddd�tddd�tddd�td	�t�at�d�t�d
d�t�at�d�t�dd
�t�at�d�t�dd�tttfD]&}|�	d�|�
ddd�|�d�q�t�t�a
t
��t
��t
�d�dS)N�logo�second_hand�}r�minute_hand��	hour_handr
�Zgray20Zgray80Zblue1Zred1Zblue3Zred3�user�rr�U)�moderrZTurtler �shapeZcolorr"r$Z
resizemodeZ	shapesizeZspeedZht�writerZpuZbk)rrrr�setup8s.



r,cCsdddddddg}||��S)NZMondayZTuesdayZ	WednesdayZThursdayZFridayZSaturdayZSunday)Zweekday)�t�	wochentagrrrr.Ss�r.cCsDddddddddd	d
ddg}|j}||jd
}|j}d|||fS)NzJan.zFeb.zMar.zApr.ZMayZJuneZJulyzAug.zSep.zOct.zNov.zDec.r'z%s %d %d)ZyearZmonthZday)�zZmonat�j�mr-rrr�datumXs�r2cCs�t��}|j|jd}|j|d}|j|d}z�td�t��t�	�t�
d�tjt|�ddd�t�
d�tjt|�ddd�t�
d	�td
�t�d|�t�d|�t�d|�td
�ttd
�Wntk
r�YnXdS)Ng���ư>gN@F�A�center)ZCourier�Zbold)ZalignZfont�r(Tr��d)rZtoday�secondZmicrosecond�minuteZhour�tracerr+�clear�homer�writer.Zbackr2r Z
setheadingr"r$Zontimer�tickZ
Terminator)r-Zsekunder:Zstunderrrr?`s6

�

�
r?cCs td�t�td�t�dS)NFTZ	EVENTLOOP)r;r,r?rrrr�mainys
r@�__main__rN)r)Zturtlerr	rrrr,r.r2r?r@�__name__r)�msg�printZmainlooprrrr�<module>
s
	
PK�Q�ZrW��,__pycache__/round_dance.cpython-38.opt-2.pycnu�[���U

e5d�@s4ddlTdd�Zdd�Zedkr0ee��e�dS)�)�*cCsdadS)NF)�running�rr�./usr/lib64/python3.8/turtledemo/round_dance.py�stopsrcCs�t�td�td�td�d}d}d}d}td�}td	�D]D}t|�t�}||9}||9}t|�|�	||d
d|fd�q>t
d|�td�td�t�td
d�g}td�D]:}t
d�td�td�t�|dd
kr�|�t��q�t�datt�t�d}t�r�d}	|D]6}
|
�
d�|
�d�|
�|	�|	d
k�rPdnd}	�q |dk�rztd�t|�|d9}t��qdS)NZgray10FZtriangleg}�R��c�?g���y!"@��Zcompound�
g�?ZblackZmultitriri8����������T�g�G�z�?zDONE!)ZclearscreenZbgcolorZtracer�shapeZShape�rangeZ	shapesizeZ
get_shapepolyZtiltZaddcomponentZregister_shapeZpuZsetpos�fd�lt�update�appendZclone�homerZ
onkeypressrZlisten�right)�fZphi�s�cZsh�i�pZdancersZcsZtaZdancerrrr�mains^







r�__main__N)Zturtlerr�__name__�printZmainlooprrrr�<module>s
5
PK�Q�Z��m��)__pycache__/__init__.cpython-38.opt-2.pycnu�[���U

e5d:�@sdS)N�rrr�+/usr/lib64/python3.8/turtledemo/__init__.py�<module>�PK�Q�Z���/��$__pycache__/nim.cpython-38.opt-1.pycnu�[���U

e5dq�@s�dZddlZddlZddlZdZdZdZdZedZeedd	edd
Z	dZ
dZd
Zdd�Z
dd�Zdd�ZGdd�de�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd�de�Zdd�Zed kr�e�e��dS)!z�      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.
�Ni�i�������)�?rr)���r
)r
r
r	cCst�tt�S�N)�random�randint�	MINSTICKS�	MAXSTICKS�rr�&/usr/lib64/python3.8/turtledemo/nim.py�	randomrowsrcCsb|d|dA|dA}|dkr(t|�Std�D],}|||A}|||kr0||f}|Sq0dS)Nr�r�)�
randommove�range)�stateZxored�z�s�moverrr�computerzug!srcCsHt|�}t�dd�}|||dkkrq(qt�|dk||d�}||fS)Nrrr)�maxrr
)r�mrZrandrrrr+src@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�NimModelcCs
||_dSr)�game)�selfrrrr�__init__6szNimModel.__init__cCsP|jjtjtjfkrdSt�t�t�g|_d|_d|_|jj	�
�tj|j_dS�Nr)rr�Nim�CREATED�OVERr�sticks�player�winner�view�setup�RUNNING�r rrrr*9szNimModel.setupcCs�|j|}||j|<|jj�||||j�|��rRtj|j_|j|_	|jj�
�n0|jdkr�d|_t|j�\}}|�||�d|_dS)Nrr)
r&rr)�notify_mover'�	game_overr#r%rr(�notify_overrr)r �row�col�	maxspalterrrrBs



z
NimModel.movecCs|jdddgkSr")r&r,rrrr.PszNimModel.game_overcCs"|j||krdS|�||�dSr)r&r�r r0r1rrrr-SszNimModel.notify_moveN)�__name__�
__module__�__qualname__r!r*rr.r-rrrrr5s
	rc@s$eZdZdd�Zdd�Zdd�ZdS)�StickcCs�tjj|dd�||_||_||_|�||�\}}|�d�|�t	dt
d�|�d�|��|�
||�|�d�|��dS)NF�ZvisibleZsquareg$@g4@r�white)�turtle�Turtler!r0r1r�coords�shapeZ	shapesize�HUNIT�WUNIT�speed�pu�goto�colorZ
showturtle)r r0r1r�x�yrrrr!Zs


zStick.__init__cCs^t|d�\}}dd|d|t}dd|t}|tdtdtd|tdfS)Nrrrr)�divmodr?r>�SCREENWIDTH�SCREENHEIGHT)r r0r1ZpacketZ	remainderrDrErrrr<hszStick.coordscCs*|jjtjkrdS|jj�|j|j�dSr)rrr#r+�
controllerr-r0r1)r rDrErrr�makemovenszStick.makemoveN)r4r5r6r!r<rJrrrrr7Ysr7c@s>eZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�NimViewcCs�||_|j|_|j|_|j�d�|j�d�|j�d�tjdd�|_|j�	�|j�
d�i|_td�D](}tt
�D]}t|||�|j||f<qxql|�d�|j�d�dS)	Nr	F)��rLr	r8rrz... a moment please ...T)r�screen�modelZ	colormode�tracerZbgcolorr:r;�writerrAr@r&rrr7�display)r rr0r1rrrr!us

zNimView.__init__NcCs�|j�d�|j��|dk	rT|j�dtdd�|j�d�|jj|ddd�|j�dtdd	�|j�d
�|jj|ddd�|j�d�dS)
NFrr�0Zred�center)�Courier��bold)ZalignZfont�Zblack)rT�rVT)rMrOrP�clearrBrHZpencolor�write)r Zmsg1�msg2rrrrQ�s
zNimView.displaycCs�|j�d�td�D].}t|jj|�D]}|j||f�t�q(qtd�D]0}t|jj|t�D]}|j||f�d�qbqL|�d�|j�d�dS)NFrr9�*Your turn! Click leftmost stick to remove.T)	rMrOrrNr&rC�SCOLORrrQr3rrrr*�s
z
NimView.setupcCs�|dkr2t}t||�D]}|j||f�|�qnd|�d�t�d�|�d�t}t|d|dd�D]"}t�d�|j||f�|�qh|�d�dS)	Nrz ... thinking ...         g�?z ... thinking ... aaah ...r���g�������?r\)�HCOLORrr&rCrQ�time�sleep�COLOR)r r0r1r2r'Zfarberrrrr-�s



zNimView.notify_movecCs(|jjjdkrd}nd}|�d|�dS)NrzCongrats. You're the winner!!!z"Sorry, the computer is the winner.z2To play again press space bar. To leave press ESC.)rrNr(rQ)r r[rrrr/�szNimView.notify_overcCs|jjtjkr|j��dSr)rrr#r%rMrYr,rrrrY�sz
NimView.clear)N)	r4r5r6r!rQr*r-r/rYrrrrrKts
rKc@seZdZdd�Zdd�ZdS)�
NimControllercCs|||_|jj|_d|_|j��D]}|�|j�q |jj�|jj	j
d�|jj�|jjjd�|jj�d�|jj�
�dS)NFZspaceZEscapezPress space bar to start game)rr)r&�BUSY�valuesZonclickrJrMZonkeyrNr*rYrQZlisten)r rZstickrrrr!�s
zNimController.__init__cCs*|jr
dSd|_|jj�||�d|_dS)NTF)rdrrNr-r3rrrr-�s
zNimController.notify_moveN)r4r5r6r!r-rrrrrc�srcc@s eZdZdZdZdZdd�ZdS)r#rrrcCs0tj|_||_t|�|_t|�|_t|�|_	dSr)
r#r$rrMrrNrKr)rcrI)r rMrrrr!�s


zNim.__init__N)r4r5r6r$r+r%r!rrrrr#�sr#cCs*t��}|�d�|�tt�t|�}dS)NZstandardZ	EVENTLOOP)r:ZScreen�moder*rGrHr#)Z
mainscreenZnimrrr�main�s

rg�__main__)�__doc__r:rr`rGrHrrr>r?r]r_rbrrr�objectrr;r7rKrcr#rgr4Zmainlooprrrr�<module>s0

$DPK�Q�ZZ�w��-__pycache__/two_canvases.cpython-38.opt-1.pycnu�[���U

e5d_�@s:dZddlmZmZmZdd�Zedkr6e�e��dS)z�turtledemo.two_canvases

Use TurtleScreen and RawTurtle to draw on two
distinct canvases in a separate window. The
new window must be separately closed in
addition to pressing the STOP button.
�)�TurtleScreen�	RawTurtle�TKc	CsNt��}tj|dddd�}tj|dddd�}|��|��t|�}|�ddd�t|�}|�ddd�t|�}t|�}|�dd	�|�d
�|�dd�|�d
�||fD]}|�	d
�|�
d�q�|�
d�||fD]}|��q�td�D]&}||fD]}|�
d�|�
d�q�q�||fD]*}|��|�
d�|��|�d��qdS)Ni,��z#ddffff)�widthZheightZbgz#ffeeee�333333�?�Zred)rrr�Zblue)rrr�turtle�$���2�H�6Z	EVENTLOOP)rZTkZCanvasZpackrZbgcolorrZcolorr�shape�ltZ
begin_fill�range�fdZend_fillZpuZbk)	�rootZcv1Zcv2�s1�s2�p�q�t�i�r�//usr/lib64/python3.8/turtledemo/two_canvases.py�mains>






r�__main__N)�__doc__r
rrrr�__name__Zmainlooprrrr�<module>s
)PK�Q�Z2d��II.__pycache__/fractalcurves.cpython-38.opt-1.pycnu�[���U

e5d�
�@sTdZddlTddlmZmZGdd�de�Zdd�Ze	dkrPe�Z
ee
�e�d	S)
a&      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.
�)�*)�sleep�perf_counterc@s$eZdZdd�Zdd�Zdd�ZdS)�CurvesTurtlecCs�|dkrdS|�|d�|�||d|�|�|�|�|d�|�||d|�|�|�|�||d|�|�|d�|�|�|�||d|�|�|d�dS)Nr�Z�)�left�hilbertZforward�right)�self�size�levelZparity�r�0/usr/lib64/python3.8/turtledemo/fractalcurves.pyr	s


zCurvesTurtle.hilbertcCs�ddl}d||�|j|�}|��|�|�|��|�dd|d|�t|�D] }|�|||�|�d|�q\|�	dd|d|�|��|�
|�|��dS)Nr��rih)�mathZsinZpi�pu�fd�pd�rt�range�fractal�ltZbk)r�nZradZlev�dirrZedge�irrr�
fractalgon/s

zCurvesTurtle.fractalgoncCs�|dkr|�|�dS|�|d|d|�|�d|�|�|d|d|�|�d|�|�|d|d|�|�d|�|�|d|d|�dS)Nr��<�x)rrrr)rZdistZdepthrrrrrBs
zCurvesTurtle.fractalN)�__name__�
__module__�__qualname__r	rrrrrrrsrcCs�t�}|��|�d�|��|���dd�|��d}|�d|d|�|��t	�}|�
d�|��|�|�|�
|dd�|�|�td�D]$}|�d�|�|d	|d
�q�|��td
�D]}|�|�|�d�q�|��td�D]$}|�|d|d
�|�d�q�|��t	�}d
||}td�|��|�d�|��|���dd�t	�}|�dd�|��|�dddd�|��|��|�d�|�dddd�|��t	�}|d||7}|S)Nrr�i���i��Zredrr�@r��BzHilbert: %.2fsec. ZblackZblue������zKoch: %.2fsec.)r�resetZspeedZhtZ	getscreenZtracerrZsetposr�clockZ	fillcolorZ
begin_fillrr	rrrZend_fillrZcolorr)ZftrZtar�tb�resrrr�mainNs\







r/�__main__N)
�__doc__Zturtle�timerrr,ZPenrr/r!�msg�printZmainlooprrrr�<module>s=9PK�Q�Z1�k��%__pycache__/tree.cpython-38.opt-1.pycnu�[���U

e5dx�@sXdZddlmZmZddlmZdd�Zdd�Zdd	�Z	e
d
krTe	�Zee�e�dS)a�      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.
�)�Turtle�mainloop)�perf_counterccsr|dkrng}|D]>}|�|�|��}|�|�|�|�|�|�|�|�qt|||||�D]
}dVqbdS)z� 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.�N)�forwardZclone�left�right�append�tree)Zplist�l�a�fZlst�p�q�x�r�'/usr/lib64/python3.8/turtledemo/tree.pyr
s



r
cCstt�}|�d�|��|�d�|���dd�|�d�|��|�d�|�	�t
|gddd�}|D]}qjdS)Nr��Zi.������Agffffff�?)rZ
setundobufferZ
hideturtleZspeedZ	getscreenZtracerrZpenuprZpendownr
)r�trrrr�maketree's



rcCst�}t�t�}d||S)Nzdone: %.2f sec.)�clockr)r�brrr�main5sr�__main__N)
�__doc__Zturtlerr�timerrr
rr�__name__�msg�printrrrr�<module>sPK�Q�Z8�����+__pycache__/bytedesign.cpython-38.opt-2.pycnu�[���U

e5d��@sTddlmZmZddlmZGdd�de�Zdd�ZedkrPe�Z	e
e	�e�dS)	�)�Turtle�mainloop)�perf_counterc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�DesignercCs�|��td�D]J}|�d|�|��|�|��|�|��|�d|�|�d�q|��|�|�|�d�|�d|�|�d�|��|�	d|d|�|�
��d	�dS)
N�g�����)P@�H�$g�8@���.g������a@T)�up�range�forward�down�wheel�position�backward�right�goto�centerpiece�	getscreen�tracer)�selfZhomePos�scale�i�r�-/usr/lib64/python3.8/turtledemo/bytedesign.py�design s 


zDesigner.designcCs�|�d�td�D]}|�||�q|��|�d�td�D]}|�||�q>|�d�td�D]:}|��|�d�|�d|�|��|�d|�qb|�d�|�	��
�dS)N�6�rrr�)rr�	pentpiecer�left�tripiecer
rrr�update)r�initposrrrrrr2s 




zDesigner.wheelcCs�|��}|��|�d|�|�d||�|��|�|�|�|�|��|�d|�|�d||�|��|�|�|�|�|�d�|�	��
�dS)Ng@g�?@r)�headingrr�tripolyrrr�
setheading�tripolylr!rr#)rr$r�oldhrrrr"Ds




zDesigner.tripiececCs�|��}|��|�d|�|��td�D]}|�d|�|�d�q.|�d|d|�|��|�|�|�|�|�d|�|��td�D]}|�d|�|�d�q�|�	d|d|�|��|�|�|�|�|�
d�|����dS)N�r�r�K)
r%rr
rrr�pentrrr'�pentlr!rr#)rr$rr)rrrrr Us,




zDesigner.pentpiececCs>|d|krdS|�|�|�|�|�|d|||�dS�N�gR���Q�?)r
r!r.�r�sideZangrrrrr.ms


zDesigner.pentlcCs>|d|krdS|�|�|�|�|�|d|||�dSr/)r
rr-r1rrrr-ss


zDesigner.pentrcCsh|d|krdS|�|�|�d�|�|d�|�d�|�|d�|�d�|�|d|�dS�Nr�og{�G�z�?g�������?�g�?)r
rr&�rr2rrrrr&ys



zDesigner.tripolyrcCsh|d|krdS|�|�|�d�|�|d�|�d�|�|d�|�d�|�|d|�dSr3)r
r!r(r6rrrr(�s



zDesigner.tripolylcCs>|�|�|�|�|d|kr$dS|�|d|||�dS)Ng@g333333�?)r
r!r)r�s�arrrrr�s


zDesigner.centerpieceN)�__name__�
__module__�__qualname__rrr"r r.r-r&r(rrrrrrs

rcCs\t�}|�d�|��|���d�|���d�t�}|�|��d�t�}d||S)Nrr0zruntime: %.2f sec.)	rZspeedZ
hideturtlerZdelayr�clockrr)�tZatZetrrr�main�s
r>�__main__N)Zturtlerr�timerr<rr>r9�msg�printrrrr�<module>suPK�Q�Z�)\v@@"__pycache__/penrose.cpython-38.pycnu�[���U

e5d3
�@s�dZddlTddlmZmZddlmZmZdZ	deded�Z
d	d
�Zdd�Zd
d�Z
dd�Zd&dd�Zdd�Zdd�Zdd�Zdd�Zddeddfdd�Zefd d!�Zd"d#�Zed$kr�e�Ze�d%S)'a�       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
 -------------------------------------------
�)�*)�cos�pi)�perf_counter�sleepgP�/7���?���
cCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)N�$�l���f�lt�fd�rt��l�fl�r�*/usr/lib64/python3.8/turtledemo/penrose.py�kitesrcCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)Nr
rr
rrrr�dart%srcCs�|dkrFt�\}}tt��t|d�t|d�}}}dt|||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)
NrrTr
�r���)�pos�int�heading�round�tiledictrr�inflatedartrr�inflatekite�d�r�nZpx�py�h�x�yrrrrr#1s(
"r#cCs�|dkrFt�\}}tt��t|d�t|d�}}}dt|||f<dSt|}t||d�td�t|�t	d�t
||d�td�t|t�t	d�t
||d�t|�t	d	�dS)
NrrFrr
r�6�~r)rrrr r!rr#rrrr"r$r%rrrr"Gs"
"r"cCs�t�|t|}t|d|d|�tD]T}|\}}}t||�t|�t|rftd�tdd�ntd�tdd�t�q*dS)NgY@r�black)r��?rr)r.rr)	�clearrZ	shapesizer!Zsetpos�
setheading�shapeZcolorZstamp)rr&�th�kr(r)r*rrr�drawZs


r4cCs$td�D]}t||�td�qdS�N��H)�ranger#r�rr&�irrr�sunjs
r;cCs$td�D]}t||�td�qdSr5)r8r"rr9rrr�staros
r<cCsTtd�t�td�t�tdt��t�td�t�tdt��td�dS)Nr�drrr)�tracerZ
begin_polyrZend_polyZregister_shapeZget_polyrrrrr�
makeshapestsr?cCs$t�t�t�t�td�dS)N�user)�resetZhtZpur?Z
resizemoderrrr�start�s
rB���)rrcCsxt|�td�iatd�|||�t|||�td�tdd�tD��}tdd�tD��}td||||f�dS)NrrcSsg|]}t|r|�qSr�r!��.0r)rrr�
<listcomp>�sztest.<locals>.<listcomp>cSsg|]}t|s|�qSrrErFrrrrH�sz"%d kites and %d darts = %d pieces.)�gotor0r!r>r4�len�print)rr&�fun�startposr2ZnkZndrrr�test�s
rNcCsLt�td�D]8}t�}td||�t�}||}|dkrtd|�qdS)N�i,r)rBr8�clockrNr)rLr:�a�b�trrr�demo�srTcCsjtd�tddd�tt�td�tt�td�tdd�tddd�td	d
dd�t	d
ddd�dS)NZlogog333333�?rrr-i8���gffffff�?rzPlease wait...�center)zArial Blackr
Zbold)ZalignZfontiXrO)�F�u)rMZDone)
�modeZbgcolorrTr;rr<ZpencolorrI�writerNrrrr�main�s
�rZ�__main__N)r)�__doc__ZturtleZmathrr�timerrPrrr$rrr#r"r4r;r<r?rBrNrTrZ�__name__�msgZmainlooprrrr�<module>s(


PK�Q�Z�)\v@@(__pycache__/penrose.cpython-38.opt-1.pycnu�[���U

e5d3
�@s�dZddlTddlmZmZddlmZmZdZ	deded�Z
d	d
�Zdd�Zd
d�Z
dd�Zd&dd�Zdd�Zdd�Zdd�Zdd�Zddeddfdd�Zefd d!�Zd"d#�Zed$kr�e�Ze�d%S)'a�       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
 -------------------------------------------
�)�*)�cos�pi)�perf_counter�sleepgP�/7���?���
cCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)N�$�l���f�lt�fd�rt��l�fl�r�*/usr/lib64/python3.8/turtledemo/penrose.py�kitesrcCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)Nr
rr
rrrr�dart%srcCs�|dkrFt�\}}tt��t|d�t|d�}}}dt|||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)
NrrTr
�r���)�pos�int�heading�round�tiledictrr�inflatedartrr�inflatekite�d�r�nZpx�py�h�x�yrrrrr#1s(
"r#cCs�|dkrFt�\}}tt��t|d�t|d�}}}dt|||f<dSt|}t||d�td�t|�t	d�t
||d�td�t|t�t	d�t
||d�t|�t	d	�dS)
NrrFrr
r�6�~r)rrrr r!rr#rrrr"r$r%rrrr"Gs"
"r"cCs�t�|t|}t|d|d|�tD]T}|\}}}t||�t|�t|rftd�tdd�ntd�tdd�t�q*dS)NgY@r�black)r��?rr)r.rr)	�clearrZ	shapesizer!Zsetpos�
setheading�shapeZcolorZstamp)rr&�th�kr(r)r*rrr�drawZs


r4cCs$td�D]}t||�td�qdS�N��H)�ranger#r�rr&�irrr�sunjs
r;cCs$td�D]}t||�td�qdSr5)r8r"rr9rrr�staros
r<cCsTtd�t�td�t�tdt��t�td�t�tdt��td�dS)Nr�drrr)�tracerZ
begin_polyrZend_polyZregister_shapeZget_polyrrrrr�
makeshapestsr?cCs$t�t�t�t�td�dS)N�user)�resetZhtZpur?Z
resizemoderrrr�start�s
rB���)rrcCsxt|�td�iatd�|||�t|||�td�tdd�tD��}tdd�tD��}td||||f�dS)NrrcSsg|]}t|r|�qSr�r!��.0r)rrr�
<listcomp>�sztest.<locals>.<listcomp>cSsg|]}t|s|�qSrrErFrrrrH�sz"%d kites and %d darts = %d pieces.)�gotor0r!r>r4�len�print)rr&�fun�startposr2ZnkZndrrr�test�s
rNcCsLt�td�D]8}t�}td||�t�}||}|dkrtd|�qdS)N�i,r)rBr8�clockrNr)rLr:�a�b�trrr�demo�srTcCsjtd�tddd�tt�td�tt�td�tdd�tddd�td	d
dd�t	d
ddd�dS)NZlogog333333�?rrr-i8���gffffff�?rzPlease wait...�center)zArial Blackr
Zbold)ZalignZfontiXrO)�F�u)rMZDone)
�modeZbgcolorrTr;rr<ZpencolorrI�writerNrrrr�main�s
�rZ�__main__N)r)�__doc__ZturtleZmathrr�timerrPrrr$rrr#r"r4r;r<r?rBrNrTrZ�__name__�msgZmainlooprrrr�<module>s(


PK�Q�Z1�k��__pycache__/tree.cpython-38.pycnu�[���U

e5dx�@sXdZddlmZmZddlmZdd�Zdd�Zdd	�Z	e
d
krTe	�Zee�e�dS)a�      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.
�)�Turtle�mainloop)�perf_counterccsr|dkrng}|D]>}|�|�|��}|�|�|�|�|�|�|�|�qt|||||�D]
}dVqbdS)z� 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.�N)�forwardZclone�left�right�append�tree)Zplist�l�a�fZlst�p�q�x�r�'/usr/lib64/python3.8/turtledemo/tree.pyr
s



r
cCstt�}|�d�|��|�d�|���dd�|�d�|��|�d�|�	�t
|gddd�}|D]}qjdS)Nr��Zi.������Agffffff�?)rZ
setundobufferZ
hideturtleZspeedZ	getscreenZtracerrZpenuprZpendownr
)r�trrrr�maketree's



rcCst�}t�t�}d||S)Nzdone: %.2f sec.)�clockr)r�brrr�main5sr�__main__N)
�__doc__Zturtlerr�timerrr
rr�__name__�msg�printrrrr�<module>sPK�Q�ZՁ~u��&__pycache__/paint.cpython-38.opt-2.pycnu�[���U

e5d
�@sDddlTd
dd�Zddd�Zdd�Zedkr@e�Zee�e�d	S)�)�*cCs(t�drt�t�nt�t�dS)NZpendown)ZpenZend_fillZupZdownZ
begin_fill��x�y�r�(/usr/lib64/python3.8/turtledemo/paint.py�switchupdowns

rcCs(tdd�tdd�attd�dS)N�r)�colors�colorrrrr�changecolor srcCs`td�td�td�td�ddddgattd	�t�ttd
�tt	d�ttd�dS)
NZcircle�userg�?�ZredZgreenZblueZyellowrr	�Z	EVENTLOOP)
�shapeZ
resizemodeZ	shapesize�widthr
rrZ
onscreenclickZgotorrrrr�main%s


r�__main__N)rr)rr)Zturtlerrr�__name__�msg�printZmainlooprrrr�<module>s

PK�Q�Z��eĨ�"__pycache__/rosette.cpython-38.pycnu�[���U

e5dQ�@sXdZddlmZmZmZddlmZmZdd�Z	dd�Z
edkrTe
�Ze
e�e�d	S)
aF      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().
�)�Screen�Turtle�mainloop)�perf_counter�sleepcCs�|g}td|�D](}|��}|�d|�|�|�|}qt|�D]P}t|d|�|d}|D].}|�d|�|�d|d|�|�|�qbqBdS)N�g�v@g@gffffff�?r)�rangeZcloneZrt�append�abs�pencolor�fd)�p�neZszZ
turtlelist�i�q�c�t�r�*/usr/lib64/python3.8/turtledemo/rosette.py�mn_ecks
rcCs�t�}|�d�t�}|�d�|��|�d�|�d�|�dd�t�}t	|dd�t�}||}t
d�t�}tdd	�|��D��r�|��D]}|�
�q�qvt�}d
|||S)NZblackrZred��$�rcss|]}|��VqdS)N)Zundobufferentries)�.0rrrr�	<genexpr>7szmain.<locals>.<genexpr>zruntime: %.3f sec)rZbgcolorrZspeedZ
hideturtlerZpensizeZtracer�clockrr�anyZturtlesZundo)�sr
ZatZetZz1rrrr�main$s&



r�__main__N)�__doc__Zturtlerrr�timerrrrr�__name__�msg�printrrrr�<module>sPK�Q�ZZ�w��'__pycache__/two_canvases.cpython-38.pycnu�[���U

e5d_�@s:dZddlmZmZmZdd�Zedkr6e�e��dS)z�turtledemo.two_canvases

Use TurtleScreen and RawTurtle to draw on two
distinct canvases in a separate window. The
new window must be separately closed in
addition to pressing the STOP button.
�)�TurtleScreen�	RawTurtle�TKc	CsNt��}tj|dddd�}tj|dddd�}|��|��t|�}|�ddd�t|�}|�ddd�t|�}t|�}|�dd	�|�d
�|�dd�|�d
�||fD]}|�	d
�|�
d�q�|�
d�||fD]}|��q�td�D]&}||fD]}|�
d�|�
d�q�q�||fD]*}|��|�
d�|��|�d��qdS)Ni,��z#ddffff)�widthZheightZbgz#ffeeee�333333�?�Zred)rrr�Zblue)rrr�turtle�$���2�H�6Z	EVENTLOOP)rZTkZCanvasZpackrZbgcolorrZcolorr�shape�ltZ
begin_fill�range�fdZend_fillZpuZbk)	�rootZcv1Zcv2�s1�s2�p�q�t�i�r�//usr/lib64/python3.8/turtledemo/two_canvases.py�mains>






r�__main__N)�__doc__r
rrrr�__name__Zmainlooprrrr�<module>s
)PK�Q�Z���+__pycache__/colormixer.cpython-38.opt-1.pycnu�[���U

e5d;�@sTddlmZmZmZGdd�de�Zdd�Zdd�ZedkrPe�Ze	e�e�d	S)
�)�Screen�Turtle�mainloopc@seZdZdd�Zdd�ZdS)�ColorTurtlecCs�t�|�|�d�|�d�|�ddd�|�d�dddg|_||_||j|<|�|j�|�	d�|�
d�|��|�|d�|�
�|�d�|��|�|�|�d	�|�|j�dS)
N�turtle�user���
r�Z�Zgray25)r�__init__�shapeZ
resizemodeZ	shapesizeZpensize�_color�xZcolorZspeed�left�pu�gotoZpd�setyZpencolorZondrag�shift��selfr�y�r�-/usr/lib64/python3.8/turtledemo/colormixer.pyr
s&









zColorTurtle.__init__cCs<|�tdt|d���|��|j|j<|�|j�t�dS)Nrr)r�max�min�ycorrrZ	fillcolor�
setbgcolorrrrrrszColorTurtle.shiftN)�__name__�
__module__�__qualname__r
rrrrrrsrcCst�t��t��t���dS)N)�screenZbgcolor�redr�green�bluerrrrr"srcCszt�at�d�t�dddd�tdd�atdd�atdd�at�t	�}|�
�|��|�dd	�|j
d
ddd
�dS)Nr���g333333ӿrg�������?g�?r�gffffff�?zDRAG!�center)ZArial�)ZboldZitalic)ZalignZfontZ	EVENTLOOP)rr"ZdelayZsetworldcoordinatesrr#r$r%rrZhtrr�write)�writerrrr�main%s



r,�__main__N)
rrrrrrr,r�msg�printrrrr�<module>sPK�Q�Zs���0__pycache__/planet_and_moon.cpython-38.opt-2.pycnu�[���U

e5d�@s\ddlmZmZmZmZdZGdd�de�ZGdd�de�Z	dd�Z
ed	krXe
�e�d
S)�)�Shape�Turtle�mainloop�Vec2D�c@s$eZdZdd�Zdd�Zdd�ZdS)�GravSyscCsg|_d|_d|_dS)Nrg{�G�z�?)�planets�t�dt)�self�r�2/usr/lib64/python3.8/turtledemo/planet_and_moon.py�__init__szGravSys.__init__cCs|jD]}|��qdS)N)r�init)r�prrr
rs
zGravSys.initcCs6td�D](}|j|j7_|jD]}|��q"qdS)Ni')�ranger	r
r�step)r�irrrr
�start s
z
GravSys.startN)�__name__�
__module__�__qualname__rrrrrrr
rsrc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�StarcCsTtj||d�|��||_|�|�||_|j�|�||_|�	d�|�
�dS)N)�shape�user)rrZpenup�m�setpos�vr�append�gravSysZ
resizemodeZpendown)rr�xrrrrrr
r's

z
Star.__init__cCs,|jj}|��|_|jd||j|_dS)N��?)rr
�acc�ar�rr
rrr
r1s
z	Star.initcCsRtdd�}|jjD]:}||kr|��|��}|t|jt|�d|7}q|S)Nr�)�Vecrr�pos�Gr�abs)rr#�planetrrrr
r"5s
 zStar.acccCsj|jj}|�|��||j�|jj�|�dkrJ|�|�|jjd��|�	�|_
|j||j
|_dS)Nr)rr
rr'rr�indexZ
setheadingZtowardsr"r#r$rrr
r<s
z	Star.stepN)rrrrrr"rrrrr
r&s
rcCs|t�}|��|���dd�|��|��|�d�|�d�|��|�	dd�|�
�|��}|��|�	dd�|�
�|��}td�}|�
|d�|�
|d�|���d|�|���d	d�t�}td
tdd�tdd�|d�}|�d
�|�d�|��tdtdd�tdd�|d�}|�d�|�d�td	tdd�tdd�|d�}|�d�|�d�|��|��dS)Nr��Z�ZcompoundZorangeZbluer*�i@Bg��circleZyellowg������?i�0����Zgreeng�������?��i'r!zDone!)r�resetZ	getscreenZtracerZhtZpu�fd�ltZ
begin_polyr0Zend_polyZget_polyrZaddcomponentZregister_shaperrr&ZcolorZ	shapesizeZpencolorrr)�sZm1Zm2ZplanetshapeZgsZsunZearthZmoonrrr
�mainFsD







r8�__main__N)Zturtlerrrrr&r(�objectrrr8rrrrr
�<module>s 'PK�Q�Z�%m��
�
,__pycache__/lindenmayer.cpython-38.opt-1.pycnu�[���U

e5d�	�@sDdZddlTdd�Zdd�Zdd�Zed	kr@e�Zee�e�d
S)a�       turtle-example-suite:

        xtx_lindenmayer_indian.py

Each morning women in Tamil Nadu, in southern
India, place designs, created by using rice
flour and known as kolam on the thresholds of
their homes.

These can be described by Lindenmayer systems,
which can easily be implemented with turtle
graphics and Python.

Two examples are shown here:
(1) the snake kolam
(2) anklets of Krishna

Taken from Marcia Ascher: Mathematics
Elsewhere, An Exploration of Ideas Across
Cultures

�)�*cCs4t|�D]&}d}|D]}||�||�}q|}q|S)N�)�range�get)�seqZreplacementRules�n�iZnewseqZelement�r	�./usr/lib64/python3.8/turtledemo/lindenmayer.py�replacesrc
CsR|D]H}z||�Wqtk
rJzt|||�WnYnXYqXqdS)N)�	TypeError�draw)ZcommandsZrules�br	r	r
r
&sr
cCsdd�}dd�}dd�}|||dd�}d	d
i}d}t||d�}t�td�td
d�t�t�td�t�t||�ddl	m
}|d�dd�}dd�}	dd�}
||	|
d�}ddd�}d}
t�td�tdd�t�td�t|
|d�}t||�td
�dS)NcSstd�dS�N�-)�rightr	r	r	r
�r7szmain.<locals>.rcSstd�dSr)�leftr	r	r	r
�l:szmain.<locals>.lcSstd�dS)Ng@)�forwardr	r	r	r
�f=szmain.<locals>.fzf+f+f--f--f+f+f)�-�+rrrzb+f+b--f--b+f+bz
b--f--b--f��r��)�sleepcSstd�tdd�dS)NZred�
�Z)�color�circler	r	r	r
�AVszmain.<locals>.AcSs>ddlm}td�d|d�}t|�t|d�t|�dS)Nr)�sqrtZblack��i)Zmathr"rrr )r"rr	r	r
�BZs
zmain.<locals>.BcSstd�td�dS)NZgreenr)rrr	r	r	r
�Fbszmain.<locals>.F)�arrZafbfaZ	afbfbfbfa)r'rZfbfbfbfbrzDone!)r�resetZspeedZtracerZhtZupZbackwardZdownr
�timerr)rrrZsnake_rulesZsnake_replacementRulesZsnake_startZdrawingrr!r%r&Z
krishna_rulesZkrishna_replacementRulesZ
krishna_startr	r	r
�main1s@




r*�__main__N)	�__doc__Zturtlerr
r*�__name__�msg�printZmainloopr	r	r	r
�<module>sCPK�Q�Z���/��__pycache__/nim.cpython-38.pycnu�[���U

e5dq�@s�dZddlZddlZddlZdZdZdZdZedZeedd	edd
Z	dZ
dZd
Zdd�Z
dd�Zdd�ZGdd�de�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd�de�Zdd�Zed kr�e�e��dS)!z�      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.
�Ni�i�������)�?rr)���r
)r
r
r	cCst�tt�S�N)�random�randint�	MINSTICKS�	MAXSTICKS�rr�&/usr/lib64/python3.8/turtledemo/nim.py�	randomrowsrcCsb|d|dA|dA}|dkr(t|�Std�D],}|||A}|||kr0||f}|Sq0dS)Nr�r�)�
randommove�range)�stateZxored�z�s�moverrr�computerzug!srcCsHt|�}t�dd�}|||dkkrq(qt�|dk||d�}||fS)Nrrr)�maxrr
)r�mrZrandrrrr+src@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�NimModelcCs
||_dSr)�game)�selfrrrr�__init__6szNimModel.__init__cCsP|jjtjtjfkrdSt�t�t�g|_d|_d|_|jj	�
�tj|j_dS�Nr)rr�Nim�CREATED�OVERr�sticks�player�winner�view�setup�RUNNING�r rrrr*9szNimModel.setupcCs�|j|}||j|<|jj�||||j�|��rRtj|j_|j|_	|jj�
�n0|jdkr�d|_t|j�\}}|�||�d|_dS)Nrr)
r&rr)�notify_mover'�	game_overr#r%rr(�notify_overrr)r �row�col�	maxspalterrrrBs



z
NimModel.movecCs|jdddgkSr")r&r,rrrr.PszNimModel.game_overcCs"|j||krdS|�||�dSr)r&r�r r0r1rrrr-SszNimModel.notify_moveN)�__name__�
__module__�__qualname__r!r*rr.r-rrrrr5s
	rc@s$eZdZdd�Zdd�Zdd�ZdS)�StickcCs�tjj|dd�||_||_||_|�||�\}}|�d�|�t	dt
d�|�d�|��|�
||�|�d�|��dS)NF�ZvisibleZsquareg$@g4@r�white)�turtle�Turtler!r0r1r�coords�shapeZ	shapesize�HUNIT�WUNIT�speed�pu�goto�colorZ
showturtle)r r0r1r�x�yrrrr!Zs


zStick.__init__cCs^t|d�\}}dd|d|t}dd|t}|tdtdtd|tdfS)Nrrrr)�divmodr?r>�SCREENWIDTH�SCREENHEIGHT)r r0r1ZpacketZ	remainderrDrErrrr<hszStick.coordscCs*|jjtjkrdS|jj�|j|j�dSr)rrr#r+�
controllerr-r0r1)r rDrErrr�makemovenszStick.makemoveN)r4r5r6r!r<rJrrrrr7Ysr7c@s>eZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�NimViewcCs�||_|j|_|j|_|j�d�|j�d�|j�d�tjdd�|_|j�	�|j�
d�i|_td�D](}tt
�D]}t|||�|j||f<qxql|�d�|j�d�dS)	Nr	F)��rLr	r8rrz... a moment please ...T)r�screen�modelZ	colormode�tracerZbgcolorr:r;�writerrAr@r&rrr7�display)r rr0r1rrrr!us

zNimView.__init__NcCs�|j�d�|j��|dk	rT|j�dtdd�|j�d�|jj|ddd�|j�dtdd	�|j�d
�|jj|ddd�|j�d�dS)
NFrr�0Zred�center)�Courier��bold)ZalignZfont�Zblack)rT�rVT)rMrOrP�clearrBrHZpencolor�write)r Zmsg1�msg2rrrrQ�s
zNimView.displaycCs�|j�d�td�D].}t|jj|�D]}|j||f�t�q(qtd�D]0}t|jj|t�D]}|j||f�d�qbqL|�d�|j�d�dS)NFrr9�*Your turn! Click leftmost stick to remove.T)	rMrOrrNr&rC�SCOLORrrQr3rrrr*�s
z
NimView.setupcCs�|dkr2t}t||�D]}|j||f�|�qnd|�d�t�d�|�d�t}t|d|dd�D]"}t�d�|j||f�|�qh|�d�dS)	Nrz ... thinking ...         g�?z ... thinking ... aaah ...r���g�������?r\)�HCOLORrr&rCrQ�time�sleep�COLOR)r r0r1r2r'Zfarberrrrr-�s



zNimView.notify_movecCs(|jjjdkrd}nd}|�d|�dS)NrzCongrats. You're the winner!!!z"Sorry, the computer is the winner.z2To play again press space bar. To leave press ESC.)rrNr(rQ)r r[rrrr/�szNimView.notify_overcCs|jjtjkr|j��dSr)rrr#r%rMrYr,rrrrY�sz
NimView.clear)N)	r4r5r6r!rQr*r-r/rYrrrrrKts
rKc@seZdZdd�Zdd�ZdS)�
NimControllercCs|||_|jj|_d|_|j��D]}|�|j�q |jj�|jj	j
d�|jj�|jjjd�|jj�d�|jj�
�dS)NFZspaceZEscapezPress space bar to start game)rr)r&�BUSY�valuesZonclickrJrMZonkeyrNr*rYrQZlisten)r rZstickrrrr!�s
zNimController.__init__cCs*|jr
dSd|_|jj�||�d|_dS)NTF)rdrrNr-r3rrrr-�s
zNimController.notify_moveN)r4r5r6r!r-rrrrrc�srcc@s eZdZdZdZdZdd�ZdS)r#rrrcCs0tj|_||_t|�|_t|�|_t|�|_	dSr)
r#r$rrMrrNrKr)rcrI)r rMrrrr!�s


zNim.__init__N)r4r5r6r$r+r%r!rrrrr#�sr#cCs*t��}|�d�|�tt�t|�}dS)NZstandardZ	EVENTLOOP)r:ZScreen�moder*rGrHr#)Z
mainscreenZnimrrr�main�s

rg�__main__)�__doc__r:rr`rGrHrrr>r?r]r_rbrrr�objectrr;r7rKrcr#rgr4Zmainlooprrrr�<module>s0

$DPK�Q�Z��춥
�
 __pycache__/clock.cpython-38.pycnu�[���U

e5d��@s�dZddlTddlmZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zedkr�e
d�e�Zee�e�dS)z�       turtle-example-suite:

             tdemo_clock.py

Enhanced clock-program, showing date
and time
  ------------------------------------
   Press STOP to exit the program!
  ------------------------------------
�)�*)�datetimecCs(t�t|�t|�t|�t�dS)N)Zpenup�right�forward�leftZpendown)ZdistanzZwinkel�r�(/usr/lib64/python3.8/turtledemo/clock.py�jumps
r	cCsXt|d�td�t|d�td�t|�td�t|�td�t|d�dS)Ngffffff�?�Zg@�x)�fd�rt�lt)�laenge�spitzerrr�handsrcCs>t�t|d�t�t||�t�t�}t||�dS)Ng333333�?)�resetr	Z
begin_polyrZend_polyZget_polyZregister_shape)�namerrZ	hand_formrrr�make_hand_shape"s
rcCsft�td�td�D]J}t|�|ddkrFtd�t|d�ntd�t|�td�qdS)N��<�r���)rZpensize�ranger	r�dotr
)Zradius�irrr�	clockface+s
rcCs�td�tddd�tddd�tddd�td	�t�at�d�t�d
d�t�at�d�t�dd
�t�at�d�t�dd�tttfD]&}|�	d�|�
ddd�|�d�q�t�t�a
t
��t
��t
�d�dS)N�logo�second_hand�}r�minute_hand��	hour_handr
�Zgray20Zgray80Zblue1Zred1Zblue3Zred3�user�rr�U)�moderrZTurtler �shapeZcolorr"r$Z
resizemodeZ	shapesizeZspeedZht�writerZpuZbk)rrrr�setup8s.



r,cCsdddddddg}||��S)NZMondayZTuesdayZ	WednesdayZThursdayZFridayZSaturdayZSunday)Zweekday)�t�	wochentagrrrr.Ss�r.cCsDddddddddd	d
ddg}|j}||jd
}|j}d|||fS)NzJan.zFeb.zMar.zApr.ZMayZJuneZJulyzAug.zSep.zOct.zNov.zDec.r'z%s %d %d)ZyearZmonthZday)�zZmonat�j�mr-rrr�datumXs�r2cCs�t��}|j|jd}|j|d}|j|d}z�td�t��t�	�t�
d�tjt|�ddd�t�
d�tjt|�ddd�t�
d	�td
�t�d|�t�d|�t�d|�td
�ttd
�Wntk
r�YnXdS)Ng���ư>gN@F�A�center)ZCourier�Zbold)ZalignZfont�r(Tr��d)rZtoday�secondZmicrosecond�minuteZhour�tracerr+�clear�homer�writer.Zbackr2r Z
setheadingr"r$Zontimer�tickZ
Terminator)r-Zsekunder:Zstunderrrr?`s6

�

�
r?cCs td�t�td�t�dS)NFTZ	EVENTLOOP)r;r,r?rrrr�mainys
r@�__main__rN)r)�__doc__Zturtlerr	rrrr,r.r2r?r@�__name__r)�msg�printZmainlooprrrr�<module>s 

	
PK�Q�ZOw�f�� __pycache__/chaos.cpython-38.pycnu�[���U

e5d��@sdddlTdZdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	e
dkr`e	�e�dS)�)�*�PcCsd|d|S)N�333333@����xrr�(/usr/lib64/python3.8/turtledemo/chaos.py�fsr
cCsd||dS)Nr�rrrrr	�gsrcCsd|d||S)Nrrrrrr	�hsr
cCst�t||�dS�N)Zpenup�goto)r�yrrr	�jumptosrcCst||�t�t||�dSr)r�pendownr)Zx1Zy1Zx2Zy2rrr	�lines
rcCs$tddtdd�tdddd�dS)N���rr皙������皙�����?)r�Nrrrr	�coosyssrcCsTt|�|}td|�t�td�tt�D]"}||�}t|d|�td�q,dS)Nr�r)Zpencolorrr�dot�rangerr)Zfun�startZcolorr�irrr	�plot s
rcCsxt�tddtdd�td�t�t�ttdd�ttdd�tt	dd	�t
d
�D]}td|dtdd�qXdS)
Ng�rrrrgffffff�?ZblueZgreenZred�dg�?zDone!)�resetZsetworldcoordinatesrZspeedZ
hideturtlerrr
rr
r)�srrr	�main+sr"�__main__N)Zturtlerr
rr
rrrrr"�__name__Zmainlooprrrr	�<module>sPK�Q�Z�d?;��!__pycache__/forest.cpython-38.pycnu�[���U

e5d��@s�dZddlmZmZmZmZddlmZddlm	Z
dd�Zdd�Zd	d
�Z
dd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zedkr�e�e�dS)a4     turtlegraphics-example-suite:

             tdemo_forest.py

Displays a 'forest' of 3 breadth-first-trees
similar to the one in tree.
For further remarks see tree.py

This example is a 'breadth-first'-rewrite of
a Logo program written by Erich Neuwirth. See
http://homepage.univie.ac.at/erich.neuwirth/
�)�Turtle�	colormode�tracer�mainloop��	randrange)�perf_countercCst||d�S)N�r)�n�r�)/usr/lib64/python3.8/turtledemo/forest.py�	symRandomsr
cs��fdd�|D�S)Ncs,g|]$\}}|t��|dt��f�qS)g)\��(�?)r
)�.0�angle�
sizefactor��	angledist�sizedistrr�
<listcomp>s�
�zrandomize.<locals>.<listcomp>r)�
branchlistrrrrr�	randomizes�rcCs2t|�D]$}|�t|��|�d||�qdS)Ng�?)�range�leftr
Zforward)�tZdistance�partsr�irrr�randomfdsr�
�ccs�|dkr�g}g}tt||��D]�\}	}
|	�||�|	�ddd|td�dd|td�d�|	��t|	|||�dV|
D]<\}}|	�|�|�|	�	��|�t
|
||��|	�|�q�qt||||d||||�D]
}
dVq�dS)Nr����r	)
�list�zipZpensizeZpencolorr
�pendownrr�appendZcloner�right�tree)Ztlist�size�levelZwidthfactorZbranchlistsrrZlstZbrsrrrr�xrrrr(s,�
�r(cCsLtd�|��|�d�|��|�d�|��|�||�|��dS)Nrr�Z)r�resetZspeed�
hideturtlerZpenupZsetposr%)rr+�yrrr�start7s

r0cCs2|��t|dd�t|gd|ddddgg�}|S)N�i0����P皙�����?��-g�G�z�?)r��������?�����g���Q��?�r.r0r(�r*Zpenrrrr�doit1Asr;cCs0|��t|dd�t|gd|dddgg�}|S)Niy���i~����xr3r4r7r9r:rrr�doit2Gsr=cCs2|��t|dd�t|gd|ddddgg�}|S)N�i�����dr3)r5gffffff�?)rg
ףp=
�?)r8r6r9r:rrr�doit3Msr@cCs�t�}|��tdd�tdtdd��}tdtdd��}tdtdd��}t�}d}|||fD]&}z|��Wq\|d7}Yq\Xq\|dkrNq�qNtdd	�t�}d
||S)N�Kr�r	)Zundobuffersize�r�rzruntime: %.2f sec.)rZhtrr;r=r@�clock�__next__)�p�u�sr�aZdone�brrr�mainTs$

rL�__main__N)rr)�__doc__ZturtlerrrrZrandomr�timerrEr
rrr(r0r;r=r@rL�__name__rrrr�<module>s

PK�Q�Z2d��II(__pycache__/fractalcurves.cpython-38.pycnu�[���U

e5d�
�@sTdZddlTddlmZmZGdd�de�Zdd�Ze	dkrPe�Z
ee
�e�d	S)
a&      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.
�)�*)�sleep�perf_counterc@s$eZdZdd�Zdd�Zdd�ZdS)�CurvesTurtlecCs�|dkrdS|�|d�|�||d|�|�|�|�|d�|�||d|�|�|�|�||d|�|�|d�|�|�|�||d|�|�|d�dS)Nr�Z�)�left�hilbertZforward�right)�self�size�levelZparity�r�0/usr/lib64/python3.8/turtledemo/fractalcurves.pyr	s


zCurvesTurtle.hilbertcCs�ddl}d||�|j|�}|��|�|�|��|�dd|d|�t|�D] }|�|||�|�d|�q\|�	dd|d|�|��|�
|�|��dS)Nr��rih)�mathZsinZpi�pu�fd�pd�rt�range�fractal�ltZbk)r�nZradZlev�dirrZedge�irrr�
fractalgon/s

zCurvesTurtle.fractalgoncCs�|dkr|�|�dS|�|d|d|�|�d|�|�|d|d|�|�d|�|�|d|d|�|�d|�|�|d|d|�dS)Nr��<�x)rrrr)rZdistZdepthrrrrrBs
zCurvesTurtle.fractalN)�__name__�
__module__�__qualname__r	rrrrrrrsrcCs�t�}|��|�d�|��|���dd�|��d}|�d|d|�|��t	�}|�
d�|��|�|�|�
|dd�|�|�td�D]$}|�d�|�|d	|d
�q�|��td
�D]}|�|�|�d�q�|��td�D]$}|�|d|d
�|�d�q�|��t	�}d
||}td�|��|�d�|��|���dd�t	�}|�dd�|��|�dddd�|��|��|�d�|�dddd�|��t	�}|d||7}|S)Nrr�i���i��Zredrr�@r��BzHilbert: %.2fsec. ZblackZblue������zKoch: %.2fsec.)r�resetZspeedZhtZ	getscreenZtracerrZsetposr�clockZ	fillcolorZ
begin_fillrr	rrrZend_fillrZcolorr)ZftrZtar�tb�resrrr�mainNs\







r/�__main__N)
�__doc__Zturtle�timerrr,ZPenrr/r!�msg�printZmainlooprrrr�<module>s=9PK�Q�Z:Zm��(__pycache__/penrose.cpython-38.opt-2.pycnu�[���U

e5d3
�@s�ddlTddlmZmZddlmZmZdZdeded�Z	dd	�Z
d
d�Zdd
�Zdd�Z
d%dd�Zdd�Zdd�Zdd�Zdd�Zddeddfdd�Zefdd �Zd!d"�Zed#kr�e�Ze�d$S)&�)�*)�cos�pi)�perf_counter�sleepgP�/7���?���
cCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)N�$�l���f�lt�fd�rt��l�fl�r�*/usr/lib64/python3.8/turtledemo/penrose.py�kitesrcCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)Nr
rr
rrrr�dart%srcCs�|dkrFt�\}}tt��t|d�t|d�}}}dt|||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)
NrrTr
�r���)�pos�int�heading�round�tiledictrr�inflatedartrr�inflatekite�d�r�nZpx�py�h�x�yrrrrr#1s(
"r#cCs�|dkrFt�\}}tt��t|d�t|d�}}}dt|||f<dSt|}t||d�td�t|�t	d�t
||d�td�t|t�t	d�t
||d�t|�t	d	�dS)
NrrFrr
r�6�~r)rrrr r!rr#rrrr"r$r%rrrr"Gs"
"r"cCs�t�|t|}t|d|d|�tD]T}|\}}}t||�t|�t|rftd�tdd�ntd�tdd�t�q*dS)NgY@r�black)r��?rr)r.rr)	�clearrZ	shapesizer!Zsetpos�
setheading�shapeZcolorZstamp)rr&�th�kr(r)r*rrr�drawZs


r4cCs$td�D]}t||�td�qdS�N��H)�ranger#r�rr&�irrr�sunjs
r;cCs$td�D]}t||�td�qdSr5)r8r"rr9rrr�staros
r<cCsTtd�t�td�t�tdt��t�td�t�tdt��td�dS)Nr�drrr)�tracerZ
begin_polyrZend_polyZregister_shapeZget_polyrrrrr�
makeshapestsr?cCs$t�t�t�t�td�dS)N�user)�resetZhtZpur?Z
resizemoderrrr�start�s
rB���)rrcCsxt|�td�iatd�|||�t|||�td�tdd�tD��}tdd�tD��}td||||f�dS)NrrcSsg|]}t|r|�qSr�r!��.0r)rrr�
<listcomp>�sztest.<locals>.<listcomp>cSsg|]}t|s|�qSrrErFrrrrH�sz"%d kites and %d darts = %d pieces.)�gotor0r!r>r4�len�print)rr&�fun�startposr2ZnkZndrrr�test�s
rNcCsLt�td�D]8}t�}td||�t�}||}|dkrtd|�qdS)N�i,r)rBr8�clockrNr)rLr:�a�b�trrr�demo�srTcCsjtd�tddd�tt�td�tt�td�tdd�tddd�td	d
dd�t	d
ddd�dS)NZlogog333333�?rrr-i8���gffffff�?rzPlease wait...�center)zArial Blackr
Zbold)ZalignZfontiXrO)�F�u)rMZDone)
�modeZbgcolorrTr;rr<ZpencolorrI�writerNrrrr�main�s
�rZ�__main__N)r)ZturtleZmathrr�timerrPrrr$rrr#r"r4r;r<r?rBrNrTrZ�__name__�msgZmainlooprrrr�<module>s&


PK�Q�Z���~��,__pycache__/lindenmayer.cpython-38.opt-2.pycnu�[���U

e5d�	�@s@ddlTdd�Zdd�Zdd�Zedkr<e�Zee�e�d	S)
�)�*cCs4t|�D]&}d}|D]}||�||�}q|}q|S)N�)�range�get)�seqZreplacementRules�n�iZnewseqZelement�r	�./usr/lib64/python3.8/turtledemo/lindenmayer.py�replacesrc
CsR|D]H}z||�Wqtk
rJzt|||�WnYnXYqXqdS)N)�	TypeError�draw)ZcommandsZrules�br	r	r
r
&sr
cCsdd�}dd�}dd�}|||dd�}d	d
i}d}t||d�}t�td�td
d�t�t�td�t�t||�ddl	m
}|d�dd�}dd�}	dd�}
||	|
d�}ddd�}d}
t�td�tdd�t�td�t|
|d�}t||�td
�dS)NcSstd�dS�N�-)�rightr	r	r	r
�r7szmain.<locals>.rcSstd�dSr)�leftr	r	r	r
�l:szmain.<locals>.lcSstd�dS)Ng@)�forwardr	r	r	r
�f=szmain.<locals>.fzf+f+f--f--f+f+f)�-�+rrrzb+f+b--f--b+f+bz
b--f--b--f��r��)�sleepcSstd�tdd�dS)NZred�
�Z)�color�circler	r	r	r
�AVszmain.<locals>.AcSs>ddlm}td�d|d�}t|�t|d�t|�dS)Nr)�sqrtZblack��i)Zmathr"rrr )r"rr	r	r
�BZs
zmain.<locals>.BcSstd�td�dS)NZgreenr)rrr	r	r	r
�Fbszmain.<locals>.F)�arrZafbfaZ	afbfbfbfa)r'rZfbfbfbfbrzDone!)r�resetZspeedZtracerZhtZupZbackwardZdownr
�timerr)rrrZsnake_rulesZsnake_replacementRulesZsnake_startZdrawingrr!r%r&Z
krishna_rulesZkrishna_replacementRulesZ
krishna_startr	r	r
�main1s@




r*�__main__N)Zturtlerr
r*�__name__�msg�printZmainloopr	r	r	r
�<module>sCPK�Q�Z���%__pycache__/colormixer.cpython-38.pycnu�[���U

e5d;�@sTddlmZmZmZGdd�de�Zdd�Zdd�ZedkrPe�Ze	e�e�d	S)
�)�Screen�Turtle�mainloopc@seZdZdd�Zdd�ZdS)�ColorTurtlecCs�t�|�|�d�|�d�|�ddd�|�d�dddg|_||_||j|<|�|j�|�	d�|�
d�|��|�|d�|�
�|�d�|��|�|�|�d	�|�|j�dS)
N�turtle�user���
r�Z�Zgray25)r�__init__�shapeZ
resizemodeZ	shapesizeZpensize�_color�xZcolorZspeed�left�pu�gotoZpd�setyZpencolorZondrag�shift��selfr�y�r�-/usr/lib64/python3.8/turtledemo/colormixer.pyr
s&









zColorTurtle.__init__cCs<|�tdt|d���|��|j|j<|�|j�t�dS)Nrr)r�max�min�ycorrrZ	fillcolor�
setbgcolorrrrrrszColorTurtle.shiftN)�__name__�
__module__�__qualname__r
rrrrrrsrcCst�t��t��t���dS)N)�screenZbgcolor�redr�green�bluerrrrr"srcCszt�at�d�t�dddd�tdd�atdd�atdd�at�t	�}|�
�|��|�dd	�|j
d
ddd
�dS)Nr���g333333ӿrg�������?g�?r�gffffff�?zDRAG!�center)ZArial�)ZboldZitalic)ZalignZfontZ	EVENTLOOP)rr"ZdelayZsetworldcoordinatesrr#r$r%rrZhtrr�write)�writerrrr�main%s



r,�__main__N)
rrrrrrr,r�msg�printrrrr�<module>sPK�Q�Z��R��'__pycache__/forest.cpython-38.opt-2.pycnu�[���U

e5d��@s�ddlmZmZmZmZddlmZddlmZ	dd�Z
dd�Zdd	�Zddd
�Z
dd�Zdd�Zdd�Zdd�Zdd�Zedkr�e�e�dS)�)�Turtle�	colormode�tracer�mainloop��	randrange)�perf_countercCst||d�S)N�r)�n�r�)/usr/lib64/python3.8/turtledemo/forest.py�	symRandomsr
cs��fdd�|D�S)Ncs,g|]$\}}|t��|dt��f�qS)g)\��(�?)r
)�.0�angle�
sizefactor��	angledist�sizedistrr�
<listcomp>s�
�zrandomize.<locals>.<listcomp>r)�
branchlistrrrrr�	randomizes�rcCs2t|�D]$}|�t|��|�d||�qdS)Ng�?)�range�leftr
Zforward)�tZdistance�partsr�irrr�randomfdsr�
�ccs�|dkr�g}g}tt||��D]�\}	}
|	�||�|	�ddd|td�dd|td�d�|	��t|	|||�dV|
D]<\}}|	�|�|�|	�	��|�t
|
||��|	�|�q�qt||||d||||�D]
}
dVq�dS)Nr����r	)
�list�zipZpensizeZpencolorr
�pendownrr�appendZcloner�right�tree)Ztlist�size�levelZwidthfactorZbranchlistsrrZlstZbrsrrrr�xrrrr(s,�
�r(cCsLtd�|��|�d�|��|�d�|��|�||�|��dS)Nrr�Z)r�resetZspeed�
hideturtlerZpenupZsetposr%)rr+�yrrr�start7s

r0cCs2|��t|dd�t|gd|ddddgg�}|S)N�i0����P皙�����?��-g�G�z�?)r��������?�����g���Q��?�r.r0r(�r*Zpenrrrr�doit1Asr;cCs0|��t|dd�t|gd|dddgg�}|S)Niy���i~����xr3r4r7r9r:rrr�doit2Gsr=cCs2|��t|dd�t|gd|ddddgg�}|S)N�i�����dr3)r5gffffff�?)rg
ףp=
�?)r8r6r9r:rrr�doit3Msr@cCs�t�}|��tdd�tdtdd��}tdtdd��}tdtdd��}t�}d}|||fD]&}z|��Wq\|d7}Yq\Xq\|dkrNq�qNtdd	�t�}d
||S)N�Kr�r	)Zundobuffersize�r�rzruntime: %.2f sec.)rZhtrr;r=r@�clock�__next__)�p�u�sr�aZdone�brrr�mainTs$

rL�__main__N)rr)ZturtlerrrrZrandomr�timerrEr
rrr(r0r;r=r@rL�__name__rrrr�<module>s

PK�Q�Z0p��aa&__pycache__/paint.cpython-38.opt-1.pycnu�[���U

e5d
�@sHdZddlTddd�Zddd�Zdd�Zed	krDe�Zee�e�d
S)
ap       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 toggles between 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
 -------------------------------------------
�)�*cCs(t�drt�t�nt�t�dS)NZpendown)ZpenZend_fillZupZdownZ
begin_fill��x�y�r�(/usr/lib64/python3.8/turtledemo/paint.py�switchupdowns

rcCs(tdd�tdd�attd�dS)N�r)�colors�colorrrrr�changecolor srcCs`td�td�td�td�ddddgattd	�t�ttd
�tt	d�ttd�dS)
NZcircle�userg�?�ZredZgreenZblueZyellowrr	�Z	EVENTLOOP)
�shapeZ
resizemodeZ	shapesize�widthr
rrZ
onscreenclickZgotorrrrr�main%s


r�__main__N)rr)rr)	�__doc__Zturtlerrr�__name__�msg�printZmainlooprrrr�<module>s

PK�Q�ZOw�f��&__pycache__/chaos.cpython-38.opt-1.pycnu�[���U

e5d��@sdddlTdZdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	e
dkr`e	�e�dS)�)�*�PcCsd|d|S)N�333333@����xrr�(/usr/lib64/python3.8/turtledemo/chaos.py�fsr
cCsd||dS)Nr�rrrrr	�gsrcCsd|d||S)Nrrrrrr	�hsr
cCst�t||�dS�N)Zpenup�goto)r�yrrr	�jumptosrcCst||�t�t||�dSr)r�pendownr)Zx1Zy1Zx2Zy2rrr	�lines
rcCs$tddtdd�tdddd�dS)N���rr皙������皙�����?)r�Nrrrr	�coosyssrcCsTt|�|}td|�t�td�tt�D]"}||�}t|d|�td�q,dS)Nr�r)Zpencolorrr�dot�rangerr)Zfun�startZcolorr�irrr	�plot s
rcCsxt�tddtdd�td�t�t�ttdd�ttdd�tt	dd	�t
d
�D]}td|dtdd�qXdS)
Ng�rrrrgffffff�?ZblueZgreenZred�dg�?zDone!)�resetZsetworldcoordinatesrZspeedZ
hideturtlerrr
rr
r)�srrr	�main+sr"�__main__N)Zturtlerr
rr
rrrrr"�__name__Zmainlooprrrr	�<module>sPK�Q�Zh>�7�
�
*__pycache__/planet_and_moon.cpython-38.pycnu�[���U

e5d�@s`dZddlmZmZmZmZdZGdd�de�Z	Gdd�de�Z
dd	�Zed
kr\e�e�dS)a�       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.

�)�Shape�Turtle�mainloop�Vec2D�c@s$eZdZdd�Zdd�Zdd�ZdS)�GravSyscCsg|_d|_d|_dS)Nrg{�G�z�?)�planets�t�dt)�self�r�2/usr/lib64/python3.8/turtledemo/planet_and_moon.py�__init__szGravSys.__init__cCs|jD]}|��qdS)N)r�init)r�prrr
rs
zGravSys.initcCs6td�D](}|j|j7_|jD]}|��q"qdS)Ni')�ranger	r
r�step)r�irrrr
�start s
z
GravSys.startN)�__name__�
__module__�__qualname__rrrrrrr
rsrc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�StarcCsTtj||d�|��||_|�|�||_|j�|�||_|�	d�|�
�dS)N)�shape�user)rrZpenup�m�setpos�vr�append�gravSysZ
resizemodeZpendown)rr�xrrrrrr
r's

z
Star.__init__cCs,|jj}|��|_|jd||j|_dS)N��?)rr
�acc�ar�rr
rrr
r1s
z	Star.initcCsRtdd�}|jjD]:}||kr|��|��}|t|jt|�d|7}q|S)Nr�)�Vecrr�pos�Gr�abs)rr#�planetrrrr
r"5s
 zStar.acccCsj|jj}|�|��||j�|jj�|�dkrJ|�|�|jjd��|�	�|_
|j||j
|_dS)Nr)rr
rr'rr�indexZ
setheadingZtowardsr"r#r$rrr
r<s
z	Star.stepN)rrrrrr"rrrrr
r&s
rcCs|t�}|��|���dd�|��|��|�d�|�d�|��|�	dd�|�
�|��}|��|�	dd�|�
�|��}td�}|�
|d�|�
|d�|���d|�|���d	d�t�}td
tdd�tdd�|d�}|�d
�|�d�|��tdtdd�tdd�|d�}|�d�|�d�td	tdd�tdd�|d�}|�d�|�d�|��|��dS)Nr��Z�ZcompoundZorangeZbluer*�i@Bg��circleZyellowg������?i�0����Zgreeng�������?��i'r!zDone!)r�resetZ	getscreenZtracerZhtZpu�fd�ltZ
begin_polyr0Zend_polyZget_polyrZaddcomponentZregister_shaperrr&ZcolorZ	shapesizeZpencolorrr)�sZm1Zm2ZplanetshapeZgsZsunZearthZmoonrrr
�mainFsD







r8�__main__N)
�__doc__Zturtlerrrrr&r(�objectrrr8rrrrr
�<module>s 'PK�Q�Z�&Hqq,__pycache__/round_dance.cpython-38.opt-1.pycnu�[���U

e5d�@s8dZddlTdd�Zdd�Zedkr4ee��e�dS)	aF      turtle-example-suite:

         tdemo_round_dance.py

(Needs version 1.1 of the turtle module that
comes with Python 3.1)

Dancing turtles have a compound shape
consisting of a series of triangles of
decreasing size.

Turtles march along a circle while rotating
pairwise in opposite direction, with one
exception. Does that breaking of symmetry
enhance the attractiveness of the example?

Press any key to stop the animation.

Technically: demonstrates use of compound
shapes, transformation of shapes as well as
cloning turtles. The animation is
controlled through update().
�)�*cCsdadS)NF)�running�rr�./usr/lib64/python3.8/turtledemo/round_dance.py�stopsrcCs�t�td�td�td�d}d}d}d}td�}td	�D]D}t|�t�}||9}||9}t|�|�	||d
d|fd�q>t
d|�td�td�t�td
d�g}td�D]:}t
d�td�td�t�|dd
kr�|�t��q�t�datt�t�d}t�r�d}	|D]6}
|
�
d�|
�d�|
�|	�|	d
k�rPdnd}	�q |dk�rztd�t|�|d9}t��qdS)NZgray10FZtriangleg}�R��c�?g���y!"@��Zcompound�
g�?ZblackZmultitriri8����������T�g�G�z�?zDONE!)ZclearscreenZbgcolorZtracer�shapeZShape�rangeZ	shapesizeZ
get_shapepolyZtiltZaddcomponentZregister_shapeZpuZsetpos�fd�lt�update�appendZclone�homerZ
onkeypressrZlisten�right)�fZphi�s�cZsh�i�pZdancersZcsZtaZdancerrrr�mains^







r�__main__N)�__doc__Zturtlerr�__name__�printZmainlooprrrr�<module>s5
PK�Q�Z0p��aa __pycache__/paint.cpython-38.pycnu�[���U

e5d
�@sHdZddlTddd�Zddd�Zdd�Zed	krDe�Zee�e�d
S)
ap       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 toggles between 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
 -------------------------------------------
�)�*cCs(t�drt�t�nt�t�dS)NZpendown)ZpenZend_fillZupZdownZ
begin_fill��x�y�r�(/usr/lib64/python3.8/turtledemo/paint.py�switchupdowns

rcCs(tdd�tdd�attd�dS)N�r)�colors�colorrrrr�changecolor srcCs`td�td�td�td�ddddgattd	�t�ttd
�tt	d�ttd�dS)
NZcircle�userg�?�ZredZgreenZblueZyellowrr	�Z	EVENTLOOP)
�shapeZ
resizemodeZ	shapesize�widthr
rrZ
onscreenclickZgotorrrrr�main%s


r�__main__N)rr)rr)	�__doc__Zturtlerrr�__name__�msg�printZmainlooprrrr�<module>s

PK�Q�Z��C�NN(__pycache__/rosette.cpython-38.opt-2.pycnu�[���U

e5dQ�@sTddlmZmZmZddlmZmZdd�Zdd�Z	e
dkrPe	�Zee�e�dS)	�)�Screen�Turtle�mainloop)�perf_counter�sleepcCs�|g}td|�D](}|��}|�d|�|�|�|}qt|�D]P}t|d|�|d}|D].}|�d|�|�d|d|�|�|�qbqBdS)N�g�v@g@gffffff�?r)�rangeZcloneZrt�append�abs�pencolor�fd)�p�neZszZ
turtlelist�i�q�c�t�r�*/usr/lib64/python3.8/turtledemo/rosette.py�mn_ecks
rcCs�t�}|�d�t�}|�d�|��|�d�|�d�|�dd�t�}t	|dd�t�}||}t
d�t�}tdd	�|��D��r�|��D]}|�
�q�qvt�}d
|||S)NZblackrZred��$�rcss|]}|��VqdS)N)Zundobufferentries)�.0rrrr�	<genexpr>7szmain.<locals>.<genexpr>zruntime: %.3f sec)rZbgcolorrZspeedZ
hideturtlerZpensizeZtracer�clockrr�anyZturtlesZundo)�sr
ZatZetZz1rrrr�main$s&



r�__main__N)
Zturtlerrr�timerrrrr�__name__�msg�printrrrr�<module>sPK�Q�Z;���*__pycache__/sorting_animate.cpython-38.pycnu�[���U

��.e��@s�dZddlTddlZGdd�de�ZGdd�de�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zd%dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"Zd#Zed$kr�e�Ze�dS)&a�

         sorting_animation.py

A minimal sorting algorithm animation:
Sorts a shelf of 10 blocks using insertion
sort, selection sort and quicksort.

Shelfs are implemented using builtin lists.

Blocks are turtles with shape "square", but
stretched to rectangles by shapesize()
 ---------------------------------------
       To exit press space button
 ---------------------------------------
�)�*Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�BlockcCsF||_tj|ddd�|��|�|ddd�|�d�|��dS)NZsquareF)�shapeZvisibleg�?��black)�size�Turtle�__init__Zpu�	shapesize�	fillcolor�st)�selfr�r�2/usr/lib64/python3.8/turtledemo/sorting_animate.pyr	s
zBlock.__init__cCs|�d�dS)NZred�r�r
rrr�glowsz
Block.glowcCs|�d�dS)Nrrrrrr�unglow"szBlock.unglowcCsd�|j�S)NzBlock size: {0})�formatrrrrr�__repr__%szBlock.__repr__N)�__name__�
__module__�__qualname__r	rrrrrrrrsrc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�ShelfcCs||_d|_dS)z.create a shelf. y is y-position of first blockij���N)�y�x)r
rrrrr	+szShelf.__init__cCsP|��\}}}|dd}|�|j|�|�|jdt|��|�|�dS)Nr��")r
�setyr�setxr�len�append)r
�d�width�_�y_offsetrrr�push0s
z
Shelf.pushcCs0||d�D]}|��\}}|�|d�qdS�Nr��posr�r
�i�bZxposr$rrr�_close_gap_from_i8szShelf._close_gap_from_icCs0||d�D]}|��\}}|�|d�qdSr'r(r*rrr�_open_gap_from_i=szShelf._open_gap_from_icCs,t�||�}|��|�d�|�|�|S)N��)�list�poprrr-)r
�keyr,rrrr1Bs


z	Shelf.popcCsb|�|�t�|||�|�|jd|�|��\}}}|dd}|�|j|�|��dS)Nrrr)	r.r0�insertrrr
rrr)r
r2r,r#r$r%rrrr3Is
zShelf.insertN)	rrrr	r&r-r.r1r3rrrrr)srcCs\t|�}td|�D]D}|}|dkrD||j||djkrD|d}q|�||�|��qdS)N�r�r �rangerr3r1)�shelf�lengthr+Zholerrr�isortSs 
r9cCsjt|�}td|d�D]N}|}t|d|�D]}||j||jkr,|}q,||kr|�||�|��qdS)Nrr4r5)r7r8�jZiminr+rrr�ssort\sr;cCsn||}|�||�|��|}t||�D].}||j|jkr(|�||�|��|d}q(|�||�|��|S�Nr4)r3r1r6r)r7�left�right�pivot_indexZpivotZstore_indexr+rrr�	partitionfs
r@cCs>||kr:|}t||||�}t|||d�t||d|�dSr<)r@�qsort)r7r=r>r?Zpivot_new_indexrrrrAqs
rAcCs�t�t�ttd��}t�|�t|�D]@\}}t|tt��D](}t|j	|dkr@t�
|t�|��q@q*tt
�ttdd�t�dS)N�
r4��line)�disable_keys�clearr0r6�randomZshuffle�	enumerater �srr3r1�	show_text�
instructions1�
instructions2�enable_keys)�targetr+�tr:rrr�	randomizexs
rPcCs(d|}tdd|�t|ddd�dS)Nrri����center)ZCourier�Zbold)ZalignZfont)Zgoto�write)�textrDrrrrJ�srJcCs@t�t�td�tt�t�tt�ttdd�t�dS)NzSelection Sortr4rC)rErFrJr;rIrKrLrMrrrr�start_ssort�srUcCs@t�t�td�tt�t�tt�ttdd�t�dS)NzInsertion Sortr4rC)rErFrJr9rIrKrLrMrrrr�start_isort�srVcCsLt�t�td�ttdtt�d�t�tt�ttdd�t�dS)NZ	Quicksortrr4rC)	rErFrJrArIr rKrLrMrrrr�start_qsort�srWcCs(td�ad}|D]}t�t|��qdS)Ni8���)
�r��	r4�rB���)rrIr&r)Zvalsr+rrr�
init_shelf�sr_cCs,tdd�tdd�tdd�tdd�dS)NrIr+�q�r)�onkeyrrrrrE�s


rEcCs6ttd�ttd�ttd�ttd�ttd�dS)Nr+rIr`raZspace)rbrVrUrWrPZbyerrrrrM�s




rMcCs@t���t�t�t�tt�ttdd�t�t	�dS)Nr4rCZ	EVENTLOOP)
Z	getscreenZclearscreenZhtZpenupr_rJrKrLrMZlistenrrrr�main�s
rczApress i for insertion sort, s for selection sort, q for quicksortz spacebar to quit, r to randomize�__main__)r)�__doc__ZturtlerGrrr0rr9r;r@rArPrJrUrVrWr_rErMrcrKrLr�msgZmainlooprrrr�<module>s,*	





PK�Q�Zt��

.__pycache__/fractalcurves.cpython-38.opt-2.pycnu�[���U

e5d�
�@sPddlTddlmZmZGdd�de�Zdd�ZedkrLe�Z	e
e	�e�dS)	�)�*)�sleep�perf_counterc@s$eZdZdd�Zdd�Zdd�ZdS)�CurvesTurtlecCs�|dkrdS|�|d�|�||d|�|�|�|�|d�|�||d|�|�|�|�||d|�|�|d�|�|�|�||d|�|�|d�dS)Nr�Z�)�left�hilbertZforward�right)�self�size�levelZparity�r�0/usr/lib64/python3.8/turtledemo/fractalcurves.pyr	s


zCurvesTurtle.hilbertcCs�ddl}d||�|j|�}|��|�|�|��|�dd|d|�t|�D] }|�|||�|�d|�q\|�	dd|d|�|��|�
|�|��dS)Nr��rih)�mathZsinZpi�pu�fd�pd�rt�range�fractal�ltZbk)r�nZradZlev�dirrZedge�irrr�
fractalgon/s

zCurvesTurtle.fractalgoncCs�|dkr|�|�dS|�|d|d|�|�d|�|�|d|d|�|�d|�|�|d|d|�|�d|�|�|d|d|�dS)Nr��<�x)rrrr)rZdistZdepthrrrrrBs
zCurvesTurtle.fractalN)�__name__�
__module__�__qualname__r	rrrrrrrsrcCs�t�}|��|�d�|��|���dd�|��d}|�d|d|�|��t	�}|�
d�|��|�|�|�
|dd�|�|�td�D]$}|�d�|�|d	|d
�q�|��td
�D]}|�|�|�d�q�|��td�D]$}|�|d|d
�|�d�q�|��t	�}d
||}td�|��|�d�|��|���dd�t	�}|�dd�|��|�dddd�|��|��|�d�|�dddd�|��t	�}|d||7}|S)Nrr�i���i��Zredrr�@r��BzHilbert: %.2fsec. ZblackZblue������zKoch: %.2fsec.)r�resetZspeedZhtZ	getscreenZtracerrZsetposr�clockZ	fillcolorZ
begin_fillrr	rrrZend_fillrZcolorr)ZftrZtar�tb�resrrr�mainNs\







r/�__main__N)Zturtle�timerrr,ZPenrr/r!�msg�printZmainlooprrrr�<module>s=9PK�Q�ZCws_--(__pycache__/yinyang.cpython-38.opt-1.pycnu�[���U

e5d4�@s4dZddlTdd�Zdd�Zedkr0e�e�dS)	z�       turtle-example-suite:

            tdemo_yinyang.py

Another drawing suitable as a beginner's
programming example.

The small circles are drawn by the circle
command.

�)�*cCs�td�td|�t�t|dd�t|d�td�t|dd�t�td�t�t|d�td�t	�t||�t�t|d�t�td�t�t
|d�t	�td�dS)N��blackg@��Zgffffff�?g333333�?)�widthZcolorZ
begin_fillZcircle�leftZend_fillZupZforward�rightZdownZbackward)ZradiusZcolor1Zcolor2�r
�*/usr/lib64/python3.8/turtledemo/yinyang.py�yins,


rcCs(t�tddd�tddd�t�dS)N��rZwhitezDone!)�resetrZhtr
r
r
r�main(s
r�__main__N)�__doc__Zturtlerr�__name__Zmainloopr
r
r
r�<module>sPK�Q�Zw� ��$__pycache__/nim.cpython-38.opt-2.pycnu�[���U

e5dq�@s�ddlZddlZddlZdZdZdZdZedZeeddedd	Zd
Z	dZ
dZd
d�Zdd�Z
dd�ZGdd�de�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd�de�Zdd�Zedkr�e�e��dS) �Ni�i�������)�?rr)���r
)r
r
r	cCst�tt�S�N)�random�randint�	MINSTICKS�	MAXSTICKS�rr�&/usr/lib64/python3.8/turtledemo/nim.py�	randomrowsrcCsb|d|dA|dA}|dkr(t|�Std�D],}|||A}|||kr0||f}|Sq0dS)Nr�r�)�
randommove�range)�stateZxored�z�s�moverrr�computerzug!srcCsHt|�}t�dd�}|||dkkrq(qt�|dk||d�}||fS)Nrrr)�maxrr
)r�mrZrandrrrr+src@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�NimModelcCs
||_dSr)�game)�selfrrrr�__init__6szNimModel.__init__cCsP|jjtjtjfkrdSt�t�t�g|_d|_d|_|jj	�
�tj|j_dS�Nr)rr�Nim�CREATED�OVERr�sticks�player�winner�view�setup�RUNNING�r rrrr*9szNimModel.setupcCs�|j|}||j|<|jj�||||j�|��rRtj|j_|j|_	|jj�
�n0|jdkr�d|_t|j�\}}|�||�d|_dS)Nrr)
r&rr)�notify_mover'�	game_overr#r%rr(�notify_overrr)r �row�col�	maxspalterrrrBs



z
NimModel.movecCs|jdddgkSr")r&r,rrrr.PszNimModel.game_overcCs"|j||krdS|�||�dSr)r&r�r r0r1rrrr-SszNimModel.notify_moveN)�__name__�
__module__�__qualname__r!r*rr.r-rrrrr5s
	rc@s$eZdZdd�Zdd�Zdd�ZdS)�StickcCs�tjj|dd�||_||_||_|�||�\}}|�d�|�t	dt
d�|�d�|��|�
||�|�d�|��dS)NF�ZvisibleZsquareg$@g4@r�white)�turtle�Turtler!r0r1r�coords�shapeZ	shapesize�HUNIT�WUNIT�speed�pu�goto�colorZ
showturtle)r r0r1r�x�yrrrr!Zs


zStick.__init__cCs^t|d�\}}dd|d|t}dd|t}|tdtdtd|tdfS)Nrrrr)�divmodr?r>�SCREENWIDTH�SCREENHEIGHT)r r0r1ZpacketZ	remainderrDrErrrr<hszStick.coordscCs*|jjtjkrdS|jj�|j|j�dSr)rrr#r+�
controllerr-r0r1)r rDrErrr�makemovenszStick.makemoveN)r4r5r6r!r<rJrrrrr7Ysr7c@s>eZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�NimViewcCs�||_|j|_|j|_|j�d�|j�d�|j�d�tjdd�|_|j�	�|j�
d�i|_td�D](}tt
�D]}t|||�|j||f<qxql|�d�|j�d�dS)	Nr	F)��rLr	r8rrz... a moment please ...T)r�screen�modelZ	colormode�tracerZbgcolorr:r;�writerrAr@r&rrr7�display)r rr0r1rrrr!us

zNimView.__init__NcCs�|j�d�|j��|dk	rT|j�dtdd�|j�d�|jj|ddd�|j�dtdd	�|j�d
�|jj|ddd�|j�d�dS)
NFrr�0Zred�center)�Courier��bold)ZalignZfont�Zblack)rT�rVT)rMrOrP�clearrBrHZpencolor�write)r Zmsg1�msg2rrrrQ�s
zNimView.displaycCs�|j�d�td�D].}t|jj|�D]}|j||f�t�q(qtd�D]0}t|jj|t�D]}|j||f�d�qbqL|�d�|j�d�dS)NFrr9�*Your turn! Click leftmost stick to remove.T)	rMrOrrNr&rC�SCOLORrrQr3rrrr*�s
z
NimView.setupcCs�|dkr2t}t||�D]}|j||f�|�qnd|�d�t�d�|�d�t}t|d|dd�D]"}t�d�|j||f�|�qh|�d�dS)	Nrz ... thinking ...         g�?z ... thinking ... aaah ...r���g�������?r\)�HCOLORrr&rCrQ�time�sleep�COLOR)r r0r1r2r'Zfarberrrrr-�s



zNimView.notify_movecCs(|jjjdkrd}nd}|�d|�dS)NrzCongrats. You're the winner!!!z"Sorry, the computer is the winner.z2To play again press space bar. To leave press ESC.)rrNr(rQ)r r[rrrr/�szNimView.notify_overcCs|jjtjkr|j��dSr)rrr#r%rMrYr,rrrrY�sz
NimView.clear)N)	r4r5r6r!rQr*r-r/rYrrrrrKts
rKc@seZdZdd�Zdd�ZdS)�
NimControllercCs|||_|jj|_d|_|j��D]}|�|j�q |jj�|jj	j
d�|jj�|jjjd�|jj�d�|jj�
�dS)NFZspaceZEscapezPress space bar to start game)rr)r&�BUSY�valuesZonclickrJrMZonkeyrNr*rYrQZlisten)r rZstickrrrr!�s
zNimController.__init__cCs*|jr
dSd|_|jj�||�d|_dS)NTF)rdrrNr-r3rrrr-�s
zNimController.notify_moveN)r4r5r6r!r-rrrrrc�srcc@s eZdZdZdZdZdd�ZdS)r#rrrcCs0tj|_||_t|�|_t|�|_t|�|_	dSr)
r#r$rrMrrNrKr)rcrI)r rMrrrr!�s


zNim.__init__N)r4r5r6r$r+r%r!rrrrr#�sr#cCs*t��}|�d�|�tt�t|�}dS)NZstandardZ	EVENTLOOP)r:ZScreen�moder*rGrHr#)Z
mainscreenZnimrrr�main�s

rg�__main__)r:rr`rGrHrrr>r?r]r_rbrrr�objectrr;r7rKrcr#rgr4Zmainlooprrrr�<module>
s.

$DPK�Q�Z��K�``&__pycache__/peace.cpython-38.opt-1.pycnu�[���U

e5d)�@s,dZddlTdd�Zedkr(e�e�dS)z�       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.
�)�*cCs
d}t�t�t�tdd�td�|D]@}t|�t�td�t�td�t	d�td�t
d�q,td�td	�td
d�t�td�t	d�td
�t�t	d�td�t
d�t�td�t�td�t	d�t�td�t�td
d�dS)N)Zred3ZorangeZyellowZ	seagreen4Zorchid4Z
royalblue1Zdodgerblue4i����i=����Fi��Z�B�ZwhiteriV����iT��-i,zDone!)�resetZScreenZupZgoto�widthZcolorZdownZforwardZbackward�left�rightZcircle)ZpeacecolorsZpcolor�r�(/usr/lib64/python3.8/turtledemo/peace.py�mainsH



r�__main__N)�__doc__Zturtler�__name__Zmainlooprrrr�<module>s

-PK�Q�Z�9�lZ3Z3)__pycache__/__main__.cpython-38.opt-1.pycnu�[���U

��.e�7�@sdZddlZddlZddlTddlmZmZddlmZddl	m
Z
ddlmZddl
Z
ej�ej�e��ZejdkZd	Zd
ZdZdZd
ZddefZdZdddgZdZdZdddddddddddgZ dd �Z!d!efd"efd#e
jffZ"Gd$d%�d%e#�Z$d&d'�Z%e&d(k�re%�dS))a�
  ----------------------------------------------
      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!

  The demo viewer windows can be resized. The divider between text
  and canvas can be moved by grabbing it with the mouse. The text font
  size can be changed from the menu and with Control/Command '-'/'+'.
  It can also be changed on most systems with Control-mousewheel
  when the mouse is over the text.

  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, such as clock.py are those which run EVENTDRIVEN.

      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

   - Place the file in the same directory as turtledemo/__main__.py
     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 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 open

    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.)
�N)�*)�ColorDelegator�color_config)�
Percolator)�	view_text)�__doc__�darwin������Arial�)rrZboldzLucida Console�
�normal��d��	�������cCsdd�t�t�D�S)NcSs.g|]&}|�d�r|ddkr|dd��qS)z.pyr�_N���)�endswith)�.0�entry�r"�+/usr/lib64/python3.8/turtledemo/__main__.py�
<listcomp>ts
�z%getExampleEntries.<locals>.<listcomp>)�os�listdir�demo_dirr"r"r"r#�getExampleEntriesssr(zTurtledemo helpzAbout turtledemozAbout turtle modulec@s�eZdZd(dd�Zdd�Zdd�Zdd	�Zd
d�Zd)dd
�Zd*dd�Z	dd�Z
d+dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS),�
DemoWindowNc	CsJt�|_}t_|�d�|�d|j�trbddl}|j	ddddd�
t���ddg|j
|j
d	�|jdd
d�|jdd
d�|jd
dd
d
�|jddd
d
�|jddd
d
�t|tdd�|_|jj|�|j�ddd�|jj|�|j�ddd�|jj|�|j�ddd�|j|d<ttdtdd�}|�|�|��|�|�|��|jdddd�t|d
ddddtd�|_ t!|d t"d!d"|j#d#�|_$t!|d$t"d!d"|j%d#�|_&t!|d%t"d!d"|j'd#�|_(|j jd
ddd&d'�|j$jd
d
d(d)�|j&jd
dd(d)�|j(jd
dd(d)�t)|j*��+t,��d*|_-d*|_.|�r.|�/|�|�0t1t1t1d+d,�t2|_3dS)-NzPython turtle-graphics examplesZWM_DELETE_WINDOWrZ	osascriptz-ez tell application "System Events"z>set frontmost of the first process whose unix id is {} to truezend tell)�stderr�stdoutr	)�weight�Z)Zminsizer,r
r)�relief�borderwidthZExamples)�menu�label�	underlineZFontsizeZHelpr0r
z#ddd)�orientZ	sashwidthZ
sashrelief�bgrZnews)�rowZ
columnspan�stickyz --- z#ddf)r�r)Zheight�textr4�fontr/r.z START Zwhitez#fed)r8r9�fgZdisabledforeground�commandz STOP z CLEAR )rr
)r5�columnr6�padxZew)r5r<r6FzChoose example from menu�black)4ZTk�root�turtle�_root�titleZwm_protocol�_destroyr�
subprocess�run�formatr%�getpidZDEVNULLZgrid_rowconfigureZgrid_columnconfigure�MenuZRAISEDZmBarZadd_cascade�makeLoadDemoMenu�makeFontMenu�makeHelpMenuZPanedWindow�
HORIZONTALZSOLID�add�
makeTextFrame�makeGraphFrameZgridZLabelZRIDGE�
output_lblZButton�btnfont�	startDemo�	start_btn�stopIt�stop_btn�clearCanvas�	clear_btnrr8Zinsertfilterr�dirty�exitflag�loadfile�	configGUI�DISABLED�STARTUP�state)�self�filenamer?rDZpaner"r"r#�__init__�s�
������
�
����

�zDemoWindow.__init__cCsP|j��}|j��}|j�d|j||j�|j�d|j||j�dS)Ng�?)�_canvasZwinfo_widthZwinfo_heightZxview_moveto�	canvwidthZyview_moveto�
canvheight)r_�eventZcwidthZcheightr"r"r#�onResize�s

zDemoWindow.onResizecCs6t|�|_}t|ddddd�|_}t|�t|dd�|_}|j|d<|jt	t
d	�t|d
td�|_}|j
|d<|jttd	�|j|d<|j|d
<tt�|d<tr�dnd}|�d||j�|�d||j�|�d||j�|�d||j�|�d|j�|�d|j�|�d|j�|jt	tdd�|S)Nr8r
Znone�-)�namer=Zwrap�width�vbar)rhr;)�side�fill�hbar)rhr3ZyscrollcommandZxscrollcommandr9ZCommandZControlz
<%s-minus>z<%s-underscore>z
<%s-equal>z	<%s-plus>z<Control-MouseWheel>z<Control-Button-4>z<Control-Button-5>r	)rkrl�expand)ZFrame�
text_frameZTextr8rZ	ScrollbarrjZyviewZpackZLEFT�YrLrmZxviewZBOTTOM�X�set�tuple�txtfontrZbind_all�
decrease_size�
increase_size�bind�update_mousewheelZBOTH)r_r?ror8rjrmZshortcutr"r"r#rN�s2�



zDemoWindow.makeTextFramecCs�|tj_d|_d|_t�|dd|j|j�tj_|_}|��|j�	d|j
�d|jd<t��|_}tj
�||j�|j|_|gtj_|S)Ni�i iXz<Configure>rr/)r@Z_ScreenrArcrdZScrolledCanvasrbZ
adjustScrollsZ_rootwindowrwrfZScreen�screen�TurtleScreenra�scanvasZ	RawTurtleZscreens)r_r?ZcanvasZ_s_r"r"r#rO�s$�

zDemoWindow.makeGraphFramecCs(|td<tt�|jd<d||jd<dS)Nr	r9zFont size %dr8)rtrsr8rP)r_�sizer"r"r#�set_txtsize�szDemoWindow.set_txtsizecCs|�ttddt��dS�Nr	�break)r}�maxrt�MINIMUM_FONT_SIZE�r_Zdummyr"r"r#ru�szDemoWindow.decrease_sizecCs|�ttddt��dSr~)r}�minrt�MAXIMUM_FONT_SIZEr�r"r"r#rvszDemoWindow.increase_sizecCs$|jdktkr|��S|��SdS)Nr)Zdeltarrurv)r_rer"r"r#rxszDemoWindow.update_mousewheel��bluecCsh|jj||tkrdndd�|jj||tkr0dndd�|jj||tkrLdndd�|jj||d�dS)Nz#d00z#fca)r^r4)r8r:)rS�config�NORMALrUrWrP)r_�start�stop�clearZtxtZcolorr"r"r#r[s���zDemoWindow.configGUIcs:t|�}t�D]&}|f�fdd�	}|j|dt|d�q|S)Ncs��|�dS�N)rZ)r!�r_r"r#�loadsz)DemoWindow.makeLoadDemoMenu.<locals>.loadr�r1r2r9r;)rHr(�add_command�menufont)r_�masterr0r!r�r"r�r#rIs
�zDemoWindow.makeLoadDemoMenucsht|�}|jd�jtd�|jd�jtd�|��tD]*}|f�fdd�	}|jt|�dt|d�q8|S)NzDecrease (C-'-'))r1r;r9zIncrease (C-'+')cs��|�dSr�)r})r|r�r"r#�resize(sz'DemoWindow.makeFontMenu.<locals>.resizerr�)rHr�rur�rvZ
add_separator�
font_sizes�str)r_r�r0r|r�r"r�r#rJs
�
��zDemoWindow.makeFontMenucs<t|�}tD]*\}}||f�fdd�	}|j|t|d�q|S)Ncst�j||�dSr�)rr?)�
help_label�	help_filer�r"r#�show2sz%DemoWindow.makeHelpMenu.<locals>.show)r1r9r;)rH�help_entriesr�r�)r_r�r0r�r�r�r"r�r#rK.s
zDemoWindow.makeHelpMenucCs|jr|j��d|_dS�NF)rXryr�r�r"r"r#�
refreshCanvas7s
zDemoWindow.refreshCanvasc	Cs�|��dtj_d|}t|�tj||_t|jj	d��}|�
�}W5QRX|j�dd�|j�
d|�|j�|d�|�tttdd�t|_dS)	NFzturtledemo.�rz1.0�endz# - a Python turtle graphics examplezPress start button�red)rVr@rz�_RUNNING�
__import__�sys�modules�module�open�__file__�readr8�delete�insertr?rBr[r�r\�READYr^)r_r`�modname�f�charsr"r"r#rZ<s
�zDemoWindow.loadfilecCs�|��d|_dtj_|�tttdd�|j�	�|j�
d�t|_z$|j
��}|dkr`t|_nt|_Wn0tjk
r�|jdkr�YdSt|_d}YnX|jtkr�|�ttt|�n"|jtkr�d|_|�tttdd�dS)	NTzdemo running...r>ZstandardZ	EVENTLOOPzstopped!zuse mouse/keys or STOPr�)r�rXr@rzr�r[r\r�ryr��mode�RUNNINGr^r��main�EVENTDRIVEN�DONEZ
Terminatorr?rY)r_�resultr"r"r#rRKs<
�






�

�zDemoWindow.startDemocCs4|��|j�d�|jjdd�|�ttt�dS)N�allr�)Zcursor)r�ryZ_deleter{r�r[r�r\r�r"r"r#rVhszDemoWindow.clearCanvascCs2|jr&|��d|_|�tttdd�dtj_dS)NFzSTOPPED!r�)rYrVr[r�r\r@rzr�r�r"r"r#rTns
�zDemoWindow.stopItcCsdtj_|j��d|_dSr�)r@rzr�r?Zdestroyr�r"r"r#rCvs
zDemoWindow._destroy)N)N)N)r�r�)�__name__�
__module__�__qualname__rarfrNrOr}rurvrxr[rIrJrKr�rZrRrVrTrCr"r"r"r#r)s$
D


	
	r)cCst�}|j��dSr�)r)r?Zmainloop)Zdemor"r"r#r�|sr��__main__)'rr�r%ZtkinterZidlelib.colorizerrrZidlelib.percolatorrZidlelib.textviewrZ
turtledemoZabout_turtledemor@�path�dirname�abspathr�r'�platformrr]r�r�r�r�r�r�rQrtr�r�r�r(r��objectr)r�r�r"r"r"r#�<module>s>U


�~
PK�Q�Z����~~&__pycache__/peace.cpython-38.opt-2.pycnu�[���U

e5d)�@s(ddlTdd�Zedkr$e�e�dS)�)�*cCs
d}t�t�t�tdd�td�|D]@}t|�t�td�t�td�t	d�td�t
d�q,td�td	�td
d�t�td�t	d�td
�t�t	d�td�t
d�t�td�t�td�t	d�t�td�t�td
d�dS)N)Zred3ZorangeZyellowZ	seagreen4Zorchid4Z
royalblue1Zdodgerblue4i����i=����Fi��Z�B�ZwhiteriV����iT��-i,zDone!)�resetZScreenZupZgoto�widthZcolorZdownZforwardZbackward�left�rightZcircle)ZpeacecolorsZpcolor�r�(/usr/lib64/python3.8/turtledemo/peace.py�mainsH



r�__main__N)Zturtler�__name__Zmainlooprrrr�<module>s-PK�Q�Z��Vmm(__pycache__/yinyang.cpython-38.opt-2.pycnu�[���U

e5d4�@s0ddlTdd�Zdd�Zedkr,e�e�dS)�)�*cCs�td�td|�t�t|dd�t|d�td�t|dd�t�td�t�t|d�td�t	�t||�t�t|d�t�td�t�t
|d�t	�td�dS)N��blackg@��Zgffffff�?g333333�?)�widthZcolorZ
begin_fillZcircle�leftZend_fillZupZforward�rightZdownZbackward)ZradiusZcolor1Zcolor2�r
�*/usr/lib64/python3.8/turtledemo/yinyang.py�yins,


rcCs(t�tddd�tddd�t�dS)N��rZwhitezDone!)�resetrZhtr
r
r
r�main(s
r�__main__N)Zturtlerr�__name__Zmainloopr
r
r
r�<module>s
PK�Q�Z&Ta��#__pycache__/__init__.cpython-38.pycnu�[���U

e5d:�@sdZdS)a3
    --------------------------------------
        About this viewer
    --------------------------------------

    Tiny demo viewer to view turtle graphics example scripts.

    Quickly and dirtyly assembled by Gregor Lingl.
    June, 2006

    For more information see: turtledemo - Help

    Have fun!
N)�__doc__�rr�+/usr/lib64/python3.8/turtledemo/__init__.py�<module>�PK�Q�Z��&�&)__pycache__/__main__.cpython-38.opt-2.pycnu�[���U

��.e�7�@sddlZddlZddlTddlmZmZddlmZddlm	Z	ddl
mZddl
Z
ej�ej�e��ZejdkZdZd	Zd
ZdZdZd
defZdZdddgZdZdZdddddddddddgZ dd�Z!d efd!efd"e
jffZ"Gd#d$�d$e#�Z$d%d&�Z%e&d'k�re%�dS)(�N)�*)�ColorDelegator�color_config)�
Percolator)�	view_text)�__doc__�darwin������Arial�)rrZboldzLucida Console�
�normal��d��	�������cCsdd�t�t�D�S)NcSs.g|]&}|�d�r|ddkr|dd��qS)z.pyr�_N���)�endswith)�.0�entry�r"�+/usr/lib64/python3.8/turtledemo/__main__.py�
<listcomp>ts
�z%getExampleEntries.<locals>.<listcomp>)�os�listdir�demo_dirr"r"r"r#�getExampleEntriesssr(zTurtledemo helpzAbout turtledemozAbout turtle modulec@s�eZdZd(dd�Zdd�Zdd�Zdd	�Zd
d�Zd)dd
�Zd*dd�Z	dd�Z
d+dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS),�
DemoWindowNc	CsJt�|_}t_|�d�|�d|j�trbddl}|j	ddddd�
t���ddg|j
|j
d	�|jdd
d�|jdd
d�|jd
dd
d
�|jddd
d
�|jddd
d
�t|tdd�|_|jj|�|j�ddd�|jj|�|j�ddd�|jj|�|j�ddd�|j|d<ttdtdd�}|�|�|��|�|�|��|jdddd�t|d
ddddtd�|_ t!|d t"d!d"|j#d#�|_$t!|d$t"d!d"|j%d#�|_&t!|d%t"d!d"|j'd#�|_(|j jd
ddd&d'�|j$jd
d
d(d)�|j&jd
dd(d)�|j(jd
dd(d)�t)|j*��+t,��d*|_-d*|_.|�r.|�/|�|�0t1t1t1d+d,�t2|_3dS)-NzPython turtle-graphics examplesZWM_DELETE_WINDOWrZ	osascriptz-ez tell application "System Events"z>set frontmost of the first process whose unix id is {} to truezend tell)�stderr�stdoutr	)�weight�Z)Zminsizer,r
r)�relief�borderwidthZExamples)�menu�label�	underlineZFontsizeZHelpr0r
z#ddd)�orientZ	sashwidthZ
sashrelief�bgrZnews)�rowZ
columnspan�stickyz --- z#ddf)r�r)Zheight�textr4�fontr/r.z START Zwhitez#fed)r8r9�fgZdisabledforeground�commandz STOP z CLEAR )rr
)r5�columnr6�padxZew)r5r<r6FzChoose example from menu�black)4ZTk�root�turtle�_root�titleZwm_protocol�_destroyr�
subprocess�run�formatr%�getpidZDEVNULLZgrid_rowconfigureZgrid_columnconfigure�MenuZRAISEDZmBarZadd_cascade�makeLoadDemoMenu�makeFontMenu�makeHelpMenuZPanedWindow�
HORIZONTALZSOLID�add�
makeTextFrame�makeGraphFrameZgridZLabelZRIDGE�
output_lblZButton�btnfont�	startDemo�	start_btn�stopIt�stop_btn�clearCanvas�	clear_btnrr8Zinsertfilterr�dirty�exitflag�loadfile�	configGUI�DISABLED�STARTUP�state)�self�filenamer?rDZpaner"r"r#�__init__�s�
������
�
����

�zDemoWindow.__init__cCsP|j��}|j��}|j�d|j||j�|j�d|j||j�dS)Ng�?)�_canvasZwinfo_widthZwinfo_heightZxview_moveto�	canvwidthZyview_moveto�
canvheight)r_�eventZcwidthZcheightr"r"r#�onResize�s

zDemoWindow.onResizecCs6t|�|_}t|ddddd�|_}t|�t|dd�|_}|j|d<|jt	t
d	�t|d
td�|_}|j
|d<|jttd	�|j|d<|j|d
<tt�|d<tr�dnd}|�d||j�|�d||j�|�d||j�|�d||j�|�d|j�|�d|j�|�d|j�|jt	tdd�|S)Nr8r
Znone�-)�namer=Zwrap�width�vbar)rhr;)�side�fill�hbar)rhr3ZyscrollcommandZxscrollcommandr9ZCommandZControlz
<%s-minus>z<%s-underscore>z
<%s-equal>z	<%s-plus>z<Control-MouseWheel>z<Control-Button-4>z<Control-Button-5>r	)rkrl�expand)ZFrame�
text_frameZTextr8rZ	ScrollbarrjZyviewZpackZLEFT�YrLrmZxviewZBOTTOM�X�set�tuple�txtfontrZbind_all�
decrease_size�
increase_size�bind�update_mousewheelZBOTH)r_r?ror8rjrmZshortcutr"r"r#rN�s2�



zDemoWindow.makeTextFramecCs�|tj_d|_d|_t�|dd|j|j�tj_|_}|��|j�	d|j
�d|jd<t��|_}tj
�||j�|j|_|gtj_|S)Ni�i iXz<Configure>rr/)r@Z_ScreenrArcrdZScrolledCanvasrbZ
adjustScrollsZ_rootwindowrwrfZScreen�screen�TurtleScreenra�scanvasZ	RawTurtleZscreens)r_r?ZcanvasZ_s_r"r"r#rO�s$�

zDemoWindow.makeGraphFramecCs(|td<tt�|jd<d||jd<dS)Nr	r9zFont size %dr8)rtrsr8rP)r_�sizer"r"r#�set_txtsize�szDemoWindow.set_txtsizecCs|�ttddt��dS�Nr	�break)r}�maxrt�MINIMUM_FONT_SIZE�r_Zdummyr"r"r#ru�szDemoWindow.decrease_sizecCs|�ttddt��dSr~)r}�minrt�MAXIMUM_FONT_SIZEr�r"r"r#rvszDemoWindow.increase_sizecCs$|jdktkr|��S|��SdS)Nr)Zdeltarrurv)r_rer"r"r#rxszDemoWindow.update_mousewheel��bluecCsh|jj||tkrdndd�|jj||tkr0dndd�|jj||tkrLdndd�|jj||d�dS)Nz#d00z#fca)r^r4)r8r:)rS�config�NORMALrUrWrP)r_�start�stop�clearZtxtZcolorr"r"r#r[s���zDemoWindow.configGUIcs:t|�}t�D]&}|f�fdd�	}|j|dt|d�q|S)Ncs��|�dS�N)rZ)r!�r_r"r#�loadsz)DemoWindow.makeLoadDemoMenu.<locals>.loadr�r1r2r9r;)rHr(�add_command�menufont)r_�masterr0r!r�r"r�r#rIs
�zDemoWindow.makeLoadDemoMenucsht|�}|jd�jtd�|jd�jtd�|��tD]*}|f�fdd�	}|jt|�dt|d�q8|S)NzDecrease (C-'-'))r1r;r9zIncrease (C-'+')cs��|�dSr�)r})r|r�r"r#�resize(sz'DemoWindow.makeFontMenu.<locals>.resizerr�)rHr�rur�rvZ
add_separator�
font_sizes�str)r_r�r0r|r�r"r�r#rJs
�
��zDemoWindow.makeFontMenucs<t|�}tD]*\}}||f�fdd�	}|j|t|d�q|S)Ncst�j||�dSr�)rr?)�
help_label�	help_filer�r"r#�show2sz%DemoWindow.makeHelpMenu.<locals>.show)r1r9r;)rH�help_entriesr�r�)r_r�r0r�r�r�r"r�r#rK.s
zDemoWindow.makeHelpMenucCs|jr|j��d|_dS�NF)rXryr�r�r"r"r#�
refreshCanvas7s
zDemoWindow.refreshCanvasc	Cs�|��dtj_d|}t|�tj||_t|jj	d��}|�
�}W5QRX|j�dd�|j�
d|�|j�|d�|�tttdd�t|_dS)	NFzturtledemo.�rz1.0�endz# - a Python turtle graphics examplezPress start button�red)rVr@rz�_RUNNING�
__import__�sys�modules�module�open�__file__�readr8�delete�insertr?rBr[r�r\�READYr^)r_r`�modname�f�charsr"r"r#rZ<s
�zDemoWindow.loadfilecCs�|��d|_dtj_|�tttdd�|j�	�|j�
d�t|_z$|j
��}|dkr`t|_nt|_Wn0tjk
r�|jdkr�YdSt|_d}YnX|jtkr�|�ttt|�n"|jtkr�d|_|�tttdd�dS)	NTzdemo running...r>ZstandardZ	EVENTLOOPzstopped!zuse mouse/keys or STOPr�)r�rXr@rzr�r[r\r�ryr��mode�RUNNINGr^r��main�EVENTDRIVEN�DONEZ
Terminatorr?rY)r_�resultr"r"r#rRKs<
�






�

�zDemoWindow.startDemocCs4|��|j�d�|jjdd�|�ttt�dS)N�allr�)Zcursor)r�ryZ_deleter{r�r[r�r\r�r"r"r#rVhszDemoWindow.clearCanvascCs2|jr&|��d|_|�tttdd�dtj_dS)NFzSTOPPED!r�)rYrVr[r�r\r@rzr�r�r"r"r#rTns
�zDemoWindow.stopItcCsdtj_|j��d|_dSr�)r@rzr�r?Zdestroyr�r"r"r#rCvs
zDemoWindow._destroy)N)N)N)r�r�)�__name__�
__module__�__qualname__rarfrNrOr}rurvrxr[rIrJrKr�rZrRrVrTrCr"r"r"r#r)s$
D


	
	r)cCst�}|j��dSr�)r)r?Zmainloop)Zdemor"r"r#r�|sr��__main__)'r�r%ZtkinterZidlelib.colorizerrrZidlelib.percolatorrZidlelib.textviewrZ
turtledemorZabout_turtledemor@�path�dirname�abspathr�r'�platformrr]r�r�r�r�r�r�rQrtr�r�r�r(r��objectr)r�r�r"r"r"r#�<module>Ws<


�~
PK�Q�Z��p�3
3

penrose.pynuȯ��#! /usr/bin/python3.8
"""       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 perf_counter as 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 = {}
    tracer(0)
    fun(l, n)
    draw(l, n, th)
    tracer(1)
    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�Q�Z��S��clock.pynuȯ��#! /usr/bin/python3.8
# -*- 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()
PK�Q�Z2�f�__two_canvases.pynu�[���"""turtledemo.two_canvases

Use TurtleScreen and RawTurtle to draw on two
distinct canvases in a separate window. 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�Q�Z+����
�
fractalcurves.pynuȯ��#! /usr/bin/python3.8
"""      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, perf_counter as 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.getscreen().tracer(1,0)
    ft.pu()

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

    ta=clock()
    ft.fillcolor("red")
    ft.begin_fill()
    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.end_fill()
    tb=clock()
    res =  "Hilbert: %.2fsec. " % (tb-ta)

    sleep(3)

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

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

if __name__  == '__main__':
    msg = main()
    print(msg)
    mainloop()
PK�Q�ZԚ��qqnim.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�Q�Z�r�;;
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�Q�Zf�=rplanet_and_moon.pynuȯ��#! /usr/bin/python3.8
"""       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

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.getscreen().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.getscreen().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�Q�Ztn*ܷ�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�Q�ZC|���sorting_animate.pynu�[���"""

         sorting_animation.py

A minimal sorting algorithm animation:
Sorts a shelf of 10 blocks using insertion
sort, selection sort and quicksort.

Shelfs are implemented using builtin lists.

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


class Block(Turtle):

    def __init__(self, size):
        self.size = size
        Turtle.__init__(self, shape="square", visible=False)
        self.pu()
        self.shapesize(size * 1.5, 1.5, 2) # square-->rectangle
        self.fillcolor("black")
        self.st()

    def glow(self):
        self.fillcolor("red")

    def unglow(self):
        self.fillcolor("black")

    def __repr__(self):
        return "Block size: {0}".format(self.size)


class Shelf(list):

    def __init__(self, y):
        "create a shelf. y is y-position of first block"
        self.y = y
        self.x = -150

    def push(self, d):
        width, _, _ = d.shapesize()
        # align blocks by the bottom edge
        y_offset = width / 2 * 20
        d.sety(self.y + y_offset)
        d.setx(self.x + 34 * len(self))
        self.append(d)

    def _close_gap_from_i(self, i):
        for b in self[i:]:
            xpos, _ = b.pos()
            b.setx(xpos - 34)

    def _open_gap_from_i(self, i):
        for b in self[i:]:
            xpos, _ = b.pos()
            b.setx(xpos + 34)

    def pop(self, key):
        b = list.pop(self, key)
        b.glow()
        b.sety(200)
        self._close_gap_from_i(key)
        return b

    def insert(self, key, b):
        self._open_gap_from_i(key)
        list.insert(self, key, b)
        b.setx(self.x + 34 * key)
        width, _, _ = b.shapesize()
        # align blocks by the bottom edge
        y_offset = width / 2 * 20
        b.sety(self.y + y_offset)
        b.unglow()

def isort(shelf):
    length = len(shelf)
    for i in range(1, length):
        hole = i
        while hole > 0 and shelf[i].size < shelf[hole - 1].size:
            hole = hole - 1
        shelf.insert(hole, shelf.pop(i))
    return

def ssort(shelf):
    length = len(shelf)
    for j in range(0, length - 1):
        imin = j
        for i in range(j + 1, length):
            if shelf[i].size < shelf[imin].size:
                imin = i
        if imin != j:
            shelf.insert(j, shelf.pop(imin))

def partition(shelf, left, right, pivot_index):
    pivot = shelf[pivot_index]
    shelf.insert(right, shelf.pop(pivot_index))
    store_index = left
    for i in range(left, right): # range is non-inclusive of ending value
        if shelf[i].size < pivot.size:
            shelf.insert(store_index, shelf.pop(i))
            store_index = store_index + 1
    shelf.insert(store_index, shelf.pop(right)) # move pivot to correct position
    return store_index

def qsort(shelf, left, right):
    if left < right:
        pivot_index = left
        pivot_new_index = partition(shelf, left, right, pivot_index)
        qsort(shelf, left, pivot_new_index - 1)
        qsort(shelf, pivot_new_index + 1, right)

def randomize():
    disable_keys()
    clear()
    target = list(range(10))
    random.shuffle(target)
    for i, t in enumerate(target):
        for j in range(i, len(s)):
            if s[j].size == t + 1:
                s.insert(i, s.pop(j))
    show_text(instructions1)
    show_text(instructions2, line=1)
    enable_keys()

def show_text(text, line=0):
    line = 20 * line
    goto(0,-250 - line)
    write(text, align="center", font=("Courier", 16, "bold"))

def start_ssort():
    disable_keys()
    clear()
    show_text("Selection Sort")
    ssort(s)
    clear()
    show_text(instructions1)
    show_text(instructions2, line=1)
    enable_keys()

def start_isort():
    disable_keys()
    clear()
    show_text("Insertion Sort")
    isort(s)
    clear()
    show_text(instructions1)
    show_text(instructions2, line=1)
    enable_keys()

def start_qsort():
    disable_keys()
    clear()
    show_text("Quicksort")
    qsort(s, 0, len(s) - 1)
    clear()
    show_text(instructions1)
    show_text(instructions2, line=1)
    enable_keys()

def init_shelf():
    global s
    s = Shelf(-200)
    vals = (4, 2, 8, 9, 1, 5, 10, 3, 7, 6)
    for i in vals:
        s.push(Block(i))

def disable_keys():
    onkey(None, "s")
    onkey(None, "i")
    onkey(None, "q")
    onkey(None, "r")

def enable_keys():
    onkey(start_isort, "i")
    onkey(start_ssort, "s")
    onkey(start_qsort, "q")
    onkey(randomize, "r")
    onkey(bye, "space")

def main():
    getscreen().clearscreen()
    ht(); penup()
    init_shelf()
    show_text(instructions1)
    show_text(instructions2, line=1)
    enable_keys()
    listen()
    return "EVENTLOOP"

instructions1 = "press i for insertion sort, s for selection sort, q for quicksort"
instructions2 = "spacebar to quit, r to randomize"

if __name__=="__main__":
    msg = main()
    mainloop()
PK�Q�Z�-��round_dance.pynu�[���"""      turtle-example-suite:

         tdemo_round_dance.py

(Needs version 1.1 of the turtle module that
comes with Python 3.1)

Dancing turtles have a compound shape
consisting of a series of triangles of
decreasing size.

Turtles march along a circle while rotating
pairwise in opposite direction, with one
exception. Does that breaking of symmetry
enhance the attractiveness of the example?

Press any key to stop the animation.

Technically: demonstrates use of compound
shapes, transformation of shapes as well as
cloning turtles. The animation is
controlled through update().
"""

from turtle import *

def stop():
    global running
    running = False

def main():
    global running
    clearscreen()
    bgcolor("gray10")
    tracer(False)
    shape("triangle")
    f =   0.793402
    phi = 9.064678
    s = 5
    c = 1
    # create compound shape
    sh = Shape("compound")
    for i in range(10):
        shapesize(s)
        p =get_shapepoly()
        s *= f
        c *= f
        tilt(-phi)
        sh.addcomponent(p, (c, 0.25, 1-c), "black")
    register_shape("multitri", sh)
    # create dancers
    shapesize(1)
    shape("multitri")
    pu()
    setpos(0, -200)
    dancers = []
    for i in range(180):
        fd(7)
        tilt(-4)
        lt(2)
        update()
        if i % 12 == 0:
            dancers.append(clone())
    home()
    # dance
    running = True
    onkeypress(stop)
    listen()
    cs = 1
    while running:
        ta = -4
        for dancer in dancers:
            dancer.fd(7)
            dancer.lt(2)
            dancer.tilt(ta)
            ta = -4 if ta > 0 else 2
        if cs < 180:
            right(4)
            shapesize(cs)
            cs *= 1.005
        update()
    return "DONE!"

if __name__=='__main__':
    print(main())
    mainloop()
PK�Q�Z.6�44
yinyang.pynuȯ��#! /usr/bin/python3.8
"""       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", color1)
    begin_fill()
    circle(radius/2., 180)
    circle(radius, 180)
    left(180)
    circle(-radius/2., 180)
    end_fill()
    left(90)
    up()
    forward(radius*0.35)
    right(90)
    down()
    color(color1, color2)
    begin_fill()
    circle(radius*0.15)
    end_fill()
    left(90)
    up()
    backward(radius*0.35)
    down()
    left(90)

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

if __name__ == '__main__':
    main()
    mainloop()
PK�Q�Z�X�::__init__.pynu�[���PK�Q�Zؠ�"��
ubytedesign.pynuȯ��PK�Q�Zb��))Ipeace.pynuȯ��PK�Q�Z�+z��minimal_hanoi.pynuȯ��PK�Q�Z*�)QQ
�rosette.pynu�[���PK�Q�Z��XH�7�7w$__main__.pynu�[���PK�Q�Z���ց	�	S\lindenmayer.pynuȯ��PK�Q�Zu��=

fpaint.pynuȯ��PK�Q�Z�W쭕�	Tkforest.pynuȯ��PK�Q�Z�%<�xx"wtree.pynuȯ��PK�Q�ZJȤ��
�|turtle.cfgnu�[���PK�Q�Z��K�`` �}__pycache__/peace.cpython-38.pycnu�[���PK�Q�Z��<��%[�__pycache__/bytedesign.cpython-38.pycnu�[���PK�Q�Z�V��0c�__pycache__/sorting_animate.cpython-38.opt-2.pycnu�[���PK�Q�Z��u��.ժ__pycache__/minimal_hanoi.cpython-38.opt-2.pycnu�[���PK�Q�Zh>�7�
�
0޳__pycache__/planet_and_moon.cpython-38.opt-1.pycnu�[���PK�Q�Z;���0�__pycache__/sorting_animate.cpython-38.opt-1.pycnu�[���PK�Q�Z���.�__pycache__/minimal_hanoi.cpython-38.opt-1.pycnu�[���PK�Q�Z���(��__pycache__/minimal_hanoi.cpython-38.pycnu�[���PK�Q�Z�&Hqq&��__pycache__/round_dance.cpython-38.pycnu�[���PK�Q�ZOw�f��&��__pycache__/chaos.cpython-38.opt-2.pycnu�[���PK�Q�Z�B��  -�__pycache__/two_canvases.cpython-38.opt-2.pycnu�[���PK�Q�Z��<��+6__pycache__/bytedesign.cpython-38.opt-1.pycnu�[���PK�Q�Z&��nn%D__pycache__/tree.cpython-38.opt-2.pycnu�[���PK�Q�Z�%m��
�
&__pycache__/lindenmayer.cpython-38.pycnu�[���PK�Q�Z��eĨ�([&__pycache__/rosette.cpython-38.opt-1.pycnu�[���PK�Q�Z�d?;��'[-__pycache__/forest.cpython-38.opt-1.pycnu�[���PK�Q�Z�9�lZ3Z3#�:__pycache__/__main__.cpython-38.pycnu�[���PK�Q�ZCws_--"\n__pycache__/yinyang.cpython-38.pycnu�[���PK�Q�Z��춥
�
&�r__pycache__/clock.cpython-38.opt-1.pycnu�[���PK�Q�Z���+ր__pycache__/colormixer.cpython-38.opt-2.pycnu�[���PK�Q�Z&Ta��)M�__pycache__/__init__.cpython-38.opt-1.pycnu�[���PK�Q�Z}/Í��&n�__pycache__/clock.cpython-38.opt-2.pycnu�[���PK�Q�ZrW��,~�__pycache__/round_dance.cpython-38.opt-2.pycnu�[���PK�Q�Z��m��)�__pycache__/__init__.cpython-38.opt-2.pycnu�[���PK�Q�Z���/��$Н__pycache__/nim.cpython-38.opt-1.pycnu�[���PK�Q�ZZ�w��-Ѻ__pycache__/two_canvases.cpython-38.opt-1.pycnu�[���PK�Q�Z2d��II. �__pycache__/fractalcurves.cpython-38.opt-1.pycnu�[���PK�Q�Z1�k��%��__pycache__/tree.cpython-38.opt-1.pycnu�[���PK�Q�Z8�����+��__pycache__/bytedesign.cpython-38.opt-2.pycnu�[���PK�Q�Z�)\v@@"�__pycache__/penrose.cpython-38.pycnu�[���PK�Q�Z�)\v@@(��__pycache__/penrose.cpython-38.opt-1.pycnu�[���PK�Q�Z1�k��,__pycache__/tree.cpython-38.pycnu�[���PK�Q�ZՁ~u��&:__pycache__/paint.cpython-38.opt-2.pycnu�[���PK�Q�Z��eĨ�"m__pycache__/rosette.cpython-38.pycnu�[���PK�Q�ZZ�w��'g__pycache__/two_canvases.cpython-38.pycnu�[���PK�Q�Z���+�__pycache__/colormixer.cpython-38.opt-1.pycnu�[���PK�Q�Zs���0'&__pycache__/planet_and_moon.cpython-38.opt-2.pycnu�[���PK�Q�Z�%m��
�
,a2__pycache__/lindenmayer.cpython-38.opt-1.pycnu�[���PK�Q�Z���/���=__pycache__/nim.cpython-38.pycnu�[���PK�Q�Z��춥
�
 �Z__pycache__/clock.cpython-38.pycnu�[���PK�Q�ZOw�f�� �h__pycache__/chaos.cpython-38.pycnu�[���PK�Q�Z�d?;��!�o__pycache__/forest.cpython-38.pycnu�[���PK�Q�Z2d��II(�|__pycache__/fractalcurves.cpython-38.pycnu�[���PK�Q�Z:Zm��(��__pycache__/penrose.cpython-38.opt-2.pycnu�[���PK�Q�Z���~��,��__pycache__/lindenmayer.cpython-38.opt-2.pycnu�[���PK�Q�Z���%�__pycache__/colormixer.cpython-38.pycnu�[���PK�Q�Z��R��'^�__pycache__/forest.cpython-38.opt-2.pycnu�[���PK�Q�Z0p��aa&j�__pycache__/paint.cpython-38.opt-1.pycnu�[���PK�Q�ZOw�f��&!�__pycache__/chaos.cpython-38.opt-1.pycnu�[���PK�Q�Zh>�7�
�
*)�__pycache__/planet_and_moon.cpython-38.pycnu�[���PK�Q�Z�&Hqq,!�__pycache__/round_dance.cpython-38.opt-1.pycnu�[���PK�Q�Z0p��aa ��__pycache__/paint.cpython-38.pycnu�[���PK�Q�Z��C�NN(��__pycache__/rosette.cpython-38.opt-2.pycnu�[���PK�Q�Z;���*E�__pycache__/sorting_animate.cpython-38.pycnu�[���PK�Q�Zt��

.��__pycache__/fractalcurves.cpython-38.opt-2.pycnu�[���PK�Q�ZCws_--(�	__pycache__/yinyang.cpython-38.opt-1.pycnu�[���PK�Q�Zw� ��$s__pycache__/nim.cpython-38.opt-2.pycnu�[���PK�Q�Z��K�``&�*__pycache__/peace.cpython-38.opt-1.pycnu�[���PK�Q�Z�9�lZ3Z3)Z/__pycache__/__main__.cpython-38.opt-1.pycnu�[���PK�Q�Z����~~&
c__pycache__/peace.cpython-38.opt-2.pycnu�[���PK�Q�Z��Vmm(�f__pycache__/yinyang.cpython-38.opt-2.pycnu�[���PK�Q�Z&Ta��#�j__pycache__/__init__.cpython-38.pycnu�[���PK�Q�Z��&�&)�l__pycache__/__main__.cpython-38.opt-2.pycnu�[���PK�Q�Z��p�3
3

ѓpenrose.pynuȯ��PK�Q�Z��S��>�clock.pynuȯ��PK�Q�Z2�f�__��two_canvases.pynu�[���PK�Q�Z+����
�
��fractalcurves.pynuȯ��PK�Q�ZԚ��qqd�nim.pynu�[���PK�Q�Z�r�;;
�colormixer.pynu�[���PK�Q�Zf�=r��planet_and_moon.pynuȯ��PK�Q�Ztn*ܷ���chaos.pynu�[���PK�Q�ZC|�����sorting_animate.pynu�[���PK�Q�Z�-���round_dance.pynu�[���PK�Q�Z.6�44
�	yinyang.pynuȯ��PKUU�[