forked from DhanushNehru/Python-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscenery.py
133 lines (133 loc) · 2.24 KB
/
scenery.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
from turtle import *
import random
from tkinter import messagebox
import time
setup(1350,750)
def sun_sky():
start=time.time()
colors=['orange','tomato']
getscreen()
title('Scenery')
bgcolor('light sky blue')
width(3)
up()
goto(-250,200)
down()
for i in range(25):
random.shuffle(colors)
color(colors[0])
speed(-1)
circle(40,100)
rt(-180)
up()
fd(45)
rt(95)
fd(50)
down()
circle(40,100)
up()
goto(200,120)
rt(-75)
down()
width(2)
color('white')
fillcolor('white')
begin_fill()
fd(-160)
fd(260)
circle(50,150)
circle(50,50)
for i in range(3):
rt(100)
circle(50,100+i*10)
lt(30)
rt(150)
circle(40,136)
ht()
end_fill()
width(3)
color('black')
up()
goto(180,200)
down()
rt(140)
circle(50,70)
rt(145)
up()
goto(180,200)
down()
circle(-50,70)
up()
goto(270,210)
down()
rt(-142)
circle(50,70)
rt(147)
up()
goto(270,210)
down()
circle(-50,70)
up()
goto(-650,-100)
rt(16)
down()
color('brown')
fillcolor('brown')
fd(-25)
fd(1345)
begin_fill()
for p in range(9):
lt(120)
fd(150)
lt(120)
fd(150)
lt(120)
end_fill()
color('light green')
fillcolor('light green')
begin_fill()
rt(90)
fd(250)
rt(-90)
fd(1355)
rt(-90)
fd(250)
rt(-90)
fd(1355)
end_fill()
rt(-90)
up()
goto(230,-150)
down()
color('brown')
fillcolor('brown')
begin_fill()
for i in range(2):
fd(50)
lt(90)
fd(10)
lt(90)
end_fill()
up()
goto(215,-142)
down()
color('forest green')
fillcolor('forest green')
begin_fill()
for c in range(6):
circle(10,180)
rt(180)
circle(10,180)
rt(120)
end_fill()
end=time.time()
d=end-start
title('Scenery completed in '+str(d)+' seconds')
messagebox.showinfo('Execution Time',f"Runtime of the program is {end - start} seconds")
def main():
reset()
sun_sky()
ht()
if __name__=='__main__':
main()
mainloop()