• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python
2"""       turtle-example-suite:
3
4     tdemo-I_dont_like_tiltdemo.py
5
6Demonstrates
7  (a) use of a tilted ellipse as
8      turtle shape
9  (b) stamping that shape
10
11We can remove it, if you don't like it.
12      Without using reset() ;-)
13 ---------------------------------------
14"""
15from turtle import *
16import time
17
18def 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
55if __name__=="__main__":
56    msg = main()
57    print msg
58    mainloop()
59