-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiag9.py
85 lines (81 loc) · 1.31 KB
/
diag9.py
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import turtle
import random
wn = turtle.Screen()
wn.setup(width=800, height=800)
t = turtle.Turtle()
turtle.bgcolor("black")
t.pensize(3)
t.pencolor("white")
def myPosition(x,y):
t.penup()
t.goto(x,y)
t.pendown()
myPosition(-200,0)
t.forward(60)
t.left(90)
t.forward(20)
t.left(90)
t.forward(20)
t.right(90)
t.forward(60)
t.right(90)
t.forward(20)
t.left(90)
t.forward(20)
t.left(90)
t.forward(60)
t.left(90)
t.forward(20)
t.left(90)
t.forward(20)
t.right(90)
t.forward(60)
t.right(90)
t.forward(20)
t.left(90)
t.forward(20)
t.right(270)
myPosition(0,0)
def curve():
for i in range(200):
t.right(1)
t.forward(1)
def hi():
t.fillcolor('red')
t.begin_fill()
t.left(140)
t.forward(113)
curve()
t.left(120)
curve()
t.forward(112)
t.end_fill()
hi()
t.ht()
myPosition(140,0)
t.left(140)
t.forward(90)
t.left(90)
t.forward(100)
t.left(90)
t.forward(20)
t.left(90)
t.forward(80)
t.right(90)
t.forward(50)
t.right(90)
t.forward(80)
t.left(90)
t.forward(20)
t.left(90)
t.forward(100)
t.end_fill()
def write(message,pos):
x,y=pos
t.penup()
t.goto(x,y)
t.color('white')
style=("Stencil Std", 18, "italic")
t.write(message, font=style)
write('NAME',(-85,-145))
turtle.done()