~pythonregexp2.7/python/issue2636-12

« back to all changes in this revision

Viewing changes to Demo/turtle/tdemo_I_dontlike_tiltdemo.py

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-06-09 14:52:42 UTC
  • mfrom: (39033.1.3 Regexp-2.6)
  • Revision ID: darklord@timehorse.com-20080609145242-9m268zc6u87rp1vp
Merged in changes from the core Regexp branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
"""       turtle-example-suite:
 
3
 
 
4
     tdemo-I_dont_like_tiltdemo.py
 
5
 
 
6
Demostrates
 
7
  (a) use of a tilted ellipse as
 
8
      turtle shape
 
9
  (b) stamping that shape
 
10
 
 
11
We can remove it, if you don't like it.
 
12
      Without using reset() ;-)
 
13
 ---------------------------------------
 
14
"""
 
15
from turtle import *
 
16
import time
 
17
 
 
18
def main():
 
19
    reset()
 
20
    shape("circle")
 
21
    resizemode("user")
 
22
 
 
23
    pu(); bk(24*18/6.283); rt(90); pd()
 
24
    tilt(45)
 
25
 
 
26
    pu()
 
27
 
 
28
    turtlesize(16,10,5)
 
29
    color("red", "violet")
 
30
    for i in range(18):
 
31
        fd(24)
 
32
        lt(20)
 
33
        stamp()
 
34
    color("red", "")
 
35
    for i in range(18):
 
36
        fd(24)
 
37
        lt(20)
 
38
        stamp()
 
39
 
 
40
    tilt(-15)
 
41
    turtlesize(3, 1, 4)
 
42
    color("blue", "yellow")
 
43
    for i in range(17):
 
44
        fd(24)
 
45
        lt(20)
 
46
        if i%2 == 0:
 
47
            stamp()
 
48
    time.sleep(1)
 
49
    while undobufferentries():
 
50
        undo()
 
51
    ht()
 
52
    write("OK, OVER!", align="center", font=("Courier", 18, "bold"))
 
53
    return "Done!"
 
54
 
 
55
if __name__=="__main__":
 
56
    msg = main()
 
57
    print msg
 
58
    mainloop()