File: threeTurtles.py

package info (click to toggle)
pythoncard 0.8.1-8.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 5,352 kB
  • ctags: 4,594
  • sloc: python: 42,401; makefile: 55; sh: 22
file content (38 lines) | stat: -rw-r--r-- 856 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

from wrappers import CurvesTurtle

def draw(canvas):
    # top left corner is 0,0 and bottom right is some positive x and positive y
    # so the coordinate space is not like a Logo turtle where 0,0 is the center
    # of the screen
    t1 = CurvesTurtle(canvas)
    t1.color('red')
    # show turtle
    #t1.st()
    # get rid of any previous drawing
    t1.cls()
    
    t2 = CurvesTurtle(canvas)
    t2.color('green')
    #t2.st()
    t2.left(120)
    
    t3 = CurvesTurtle(canvas)
    t3.color('blue')
    #t3.st()
    t3.left(240)

    tList = [t1, t2, t3]
    for t in tList:
        t.pu()
        t.forward(50)
        t.pd()

##    for i in range(6):
##        [t.fd(80) for t in tList]
##        [t.rt(60) for t in tList]

    #[t.cCurve(4, 10) for t in tList]
    [t.rDragon(4, 11) for t in tList]
    #[t.lDragon(4, 11) for t in tList]