-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalgeriaFlag.py
56 lines (50 loc) · 1.17 KB
/
algeriaFlag.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
import turtle
turtle.bgcolor("cyan")
turtle.title("Happy Independance Day Algeria")
def drawfillRectangle(x,y,length,width,color):
turtle.penup()
turtle.goto(x,y)
turtle.pendown()
turtle.color(color)
turtle.begin_fill()
turtle.forward(width)
turtle.right(90)
turtle.forward(length)
turtle.right(90)
turtle.forward(width)
turtle.right(90)
turtle.forward(length)
turtle.right(90)
turtle.end_fill()
def drawStar(x,y,color,length):
turtle.penup()
turtle.goto(x,y)
turtle.setheading(0)
turtle.pendown()
turtle.begin_fill()
turtle.color(color)
for star in range(0,5):
turtle.forward(length)
turtle.right(144)
turtle.end_fill()
def drawCircle(x,y,color,radius):
turtle.penup()
turtle.goto(x,y)
turtle.color(color)
turtle.begin_fill()
turtle.circle(radius)
turtle.end_fill()
def drawMoon(x,y,color,radius):
turtle.penup()
turtle.goto(x,y)
turtle.color(color)
turtle.begin_fill()
turtle.circle(radius)
turtle.end_fill()
drawfillRectangle(-230,125,280,460,'white')
drawfillRectangle(-230,125,280,230,'dark green')
drawCircle(35,-90,'red',60)
drawMoon(50,-80,'white',50)
drawStar(-5,-20,'red',60)
turtle.hideturtle()
turtle.done()