Skip to content

Commit ff058fe

Browse files
Add files via upload
1 parent 9d170f5 commit ff058fe

19 files changed

+3576
-0
lines changed

Doraemon (1).py

Lines changed: 292 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,292 @@
1+
from turtle import *
2+
# Doraemon with Python Turtle
3+
def ankur(x, y):
4+
penup()
5+
goto(x, y)
6+
pendown()
7+
8+
def aankha():
9+
fillcolor("#ffffff")
10+
begin_fill()
11+
tracer(False)
12+
a = 2.5
13+
for i in range(120):
14+
if 0 <= i < 30 or 60 <= i < 90:
15+
a -= 0.05
16+
lt(3)
17+
fd(a)
18+
else:
19+
a += 0.05
20+
lt(3)
21+
fd(a)
22+
tracer(True)
23+
end_fill()
24+
def daari():
25+
ankur(-32, 135)
26+
seth(165)
27+
fd(60)
28+
ankur(-32, 125)
29+
seth(180)
30+
fd(60)
31+
ankur(-32, 115)
32+
seth(193)
33+
fd(60)
34+
ankur(37, 135)
35+
seth(15)
36+
fd(60)
37+
ankur(37, 125)
38+
seth(0)
39+
fd(60)S
40+
ankur(37, 115)
41+
seth(-13)
42+
fd(60)
43+
44+
45+
def mukh():
46+
ankur(5, 148)
47+
seth(270)
48+
fd(100)
49+
seth(0)
50+
circle(120, 50)
51+
seth(230)
52+
circle(-120, 100)
53+
54+
55+
def muflar():
56+
fillcolor('#e70010')
57+
begin_fill()
58+
seth(0)
59+
fd(200)
60+
circle(-5, 90)
61+
fd(10)
62+
circle(-5, 90)
63+
fd(207)
64+
circle(-5, 90)
65+
fd(10)
66+
circle(-5, 90)
67+
end_fill()
68+
69+
70+
def nak():
71+
ankur(-10, 158)
72+
seth(315)
73+
fillcolor('#e70010')
74+
begin_fill()
75+
circle(20)
76+
end_fill()
77+
78+
79+
def black_aankha():
80+
seth(0)
81+
ankur(-20, 195)
82+
fillcolor('#000000')
83+
begin_fill()
84+
circle(13)
85+
end_fill()
86+
87+
pensize(6)
88+
ankur(20, 205)
89+
seth(75)
90+
circle(-10, 150)
91+
pensize(3)
92+
93+
ankur(-17, 200)
94+
seth(0)
95+
fillcolor('#ffffff')
96+
begin_fill()
97+
circle(5)
98+
end_fill()
99+
ankur(0, 0)
100+
101+
102+
def face():
103+
fd(183)
104+
lt(45)
105+
fillcolor('#ffffff')
106+
begin_fill()
107+
circle(120, 100)
108+
seth(180)
109+
# print(pos())
110+
fd(121)
111+
pendown()
112+
seth(215)
113+
circle(120, 100)
114+
end_fill()
115+
ankur(63.56, 218.24)
116+
seth(90)
117+
aankha()
118+
seth(180)
119+
penup()
120+
fd(60)
121+
pendown()
122+
seth(90)
123+
aankha()
124+
penup()
125+
seth(180)
126+
fd(64)
127+
128+
129+
def taauko():
130+
penup()
131+
circle(150, 40)
132+
pendown()
133+
fillcolor('#00a0de')
134+
begin_fill()
135+
circle(150, 280)
136+
end_fill()
137+
138+
139+
def Doraemon():
140+
taauko()
141+
142+
muflar()
143+
144+
face()
145+
146+
nak()
147+
148+
mukh()
149+
150+
daari()
151+
152+
ankur(0, 0)
153+
154+
seth(0)
155+
penup()
156+
circle(150, 50)
157+
pendown()
158+
seth(30)
159+
fd(40)
160+
seth(70)
161+
circle(-30, 270)
162+
163+
fillcolor('#00a0de')
164+
begin_fill()
165+
166+
seth(230)
167+
fd(80)
168+
seth(90)
169+
circle(1000, 1)
170+
seth(-89)
171+
circle(-1000, 10)
172+
173+
# print(pos())
174+
175+
seth(180)
176+
fd(70)
177+
seth(90)
178+
circle(30, 180)
179+
seth(180)
180+
fd(70)
181+
182+
# print(pos())
183+
seth(100)
184+
circle(-1000, 9)
185+
186+
seth(-86)
187+
circle(1000, 2)
188+
seth(230)
189+
fd(40)
190+
191+
# print(pos())
192+
193+
circle(-30, 230)
194+
seth(45)
195+
fd(81)
196+
seth(0)
197+
fd(203)
198+
circle(5, 90)
199+
fd(10)
200+
circle(5, 90)
201+
fd(7)
202+
seth(40)
203+
circle(150, 10)
204+
seth(30)
205+
fd(40)
206+
end_fill()
207+
208+
seth(70)
209+
fillcolor('#ffffff')
210+
begin_fill()
211+
circle(-30)
212+
end_fill()
213+
214+
ankur(103.74, -182.59)
215+
seth(0)
216+
fillcolor('#ffffff')
217+
begin_fill()
218+
fd(15)
219+
circle(-15, 180)
220+
fd(90)
221+
circle(-15, 180)
222+
fd(10)
223+
end_fill()
224+
225+
ankur(-96.26, -182.59)
226+
seth(180)
227+
fillcolor('#ffffff')
228+
begin_fill()
229+
fd(15)
230+
circle(15, 180)
231+
fd(90)
232+
circle(15, 180)
233+
fd(10)
234+
end_fill()
235+
236+
ankur(-133.97, -91.81)
237+
seth(50)
238+
fillcolor('#ffffff')
239+
begin_fill()
240+
circle(30)
241+
end_fill()
242+
# Doraemon with Python Turtle
243+
244+
ankur(-103.42, 15.09)
245+
seth(0)
246+
fd(38)
247+
seth(230)
248+
begin_fill()
249+
circle(90, 260)
250+
end_fill()
251+
252+
ankur(5, -40)
253+
seth(0)
254+
fd(70)
255+
seth(-90)
256+
circle(-70, 180)
257+
seth(0)
258+
fd(70)
259+
ankur(-103.42, 15.09)
260+
fd(90)
261+
seth(70)
262+
fillcolor('#ffd200')
263+
# print(pos())
264+
begin_fill()
265+
circle(-20)
266+
end_fill()
267+
seth(170)
268+
fillcolor('#ffd200')
269+
begin_fill()
270+
circle(-2, 180)
271+
seth(10)
272+
circle(-100, 22)
273+
circle(-2, 180)
274+
seth(180 - 10)
275+
circle(100, 22)
276+
end_fill()
277+
goto(-13.42, 15.09)
278+
seth(250)
279+
circle(20, 110)
280+
seth(90)
281+
fd(15)
282+
dot(10)
283+
ankur(0, -150)
284+
black_aankha()
285+
if __name__ == '__main__':
286+
screensize(800, 600, "#f0f0f0")
287+
bgcolor("black")
288+
pensize(3)
289+
speed(9)
290+
Doraemon()
291+
ankur(100, -300)
292+
mainloop()

design1.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import turtle
2+
turtle.setup(width=600, height=500)
3+
turtle.reset()
4+
turtle.hideturtle()
5+
turtle.speed(0)
6+
7+
turtle.bgcolor('black')
8+
9+
c = 0
10+
x = 0
11+
12+
colors = [
13+
#reddish colors
14+
(1.00, 0.00, 0.00),(1.00, 0.03, 0.00),(1.00, 0.05, 0.00),(1.00, 0.07, 0.00),(1.00, 0.10, 0.00),(1.00, 0.12, 0.00),(1.00, 0.15, 0.00),(1.00, 0.17, 0.00),(1.00, 0.20, 0.00),(1.00, 0.23, 0.00),(1.00, 0.25, 0.00),(1.00, 0.28, 0.00),(1.00, 0.30, 0.00),(1.00, 0.33, 0.00),(1.00, 0.35, 0.00),(1.00, 0.38, 0.00),(1.00, 0.40, 0.00),(1.00, 0.42, 0.00),(1.00, 0.45, 0.00),(1.00, 0.47, 0.00),
15+
#orangey colors
16+
(1.00, 0.50, 0.00),(1.00, 0.53, 0.00),(1.00, 0.55, 0.00),(1.00, 0.57, 0.00),(1.00, 0.60, 0.00),(1.00, 0.62, 0.00),(1.00, 0.65, 0.00),(1.00, 0.68, 0.00),(1.00, 0.70, 0.00),(1.00, 0.72, 0.00),(1.00, 0.75, 0.00),(1.00, 0.78, 0.00),(1.00, 0.80, 0.00),(1.00, 0.82, 0.00),(1.00, 0.85, 0.00),(1.00, 0.88, 0.00),(1.00, 0.90, 0.00),(1.00, 0.93, 0.00),(1.00, 0.95, 0.00),(1.00, 0.97, 0.00),
17+
#yellowy colors
18+
(1.00, 1.00, 0.00),(0.95, 1.00, 0.00),(0.90, 1.00, 0.00),(0.85, 1.00, 0.00),(0.80, 1.00, 0.00),(0.75, 1.00, 0.00),(0.70, 1.00, 0.00),(0.65, 1.00, 0.00),(0.60, 1.00, 0.00),(0.55, 1.00, 0.00),(0.50, 1.00, 0.00),(0.45, 1.00, 0.00),(0.40, 1.00, 0.00),(0.35, 1.00, 0.00),(0.30, 1.00, 0.00),(0.25, 1.00, 0.00),(0.20, 1.00, 0.00),(0.15, 1.00, 0.00),(0.10, 1.00, 0.00),(0.05, 1.00, 0.00),
19+
#greenish colors
20+
(0.00, 1.00, 0.00),(0.00, 0.95, 0.05),(0.00, 0.90, 0.10),(0.00, 0.85, 0.15),(0.00, 0.80, 0.20),(0.00, 0.75, 0.25),(0.00, 0.70, 0.30),(0.00, 0.65, 0.35),(0.00, 0.60, 0.40),(0.00, 0.55, 0.45),(0.00, 0.50, 0.50),(0.00, 0.45, 0.55),(0.00, 0.40, 0.60),(0.00, 0.35, 0.65),(0.00, 0.30, 0.70),(0.00, 0.25, 0.75),(0.00, 0.20, 0.80),(0.00, 0.15, 0.85),(0.00, 0.10, 0.90),(0.00, 0.05, 0.95),
21+
#blueish colors
22+
(0.00, 0.00, 1.00),(0.05, 0.00, 1.00),(0.10, 0.00, 1.00),(0.15, 0.00, 1.00),(0.0, 0.00, 1.00),(0.25, 0.00, 1.00),(0.30, 0.00, 1.00),(0.35, 0.00, 1.00),(0.40, 0.00, 1.00),(0.45, 0.00, 1.00),(0.50, 0.00, 1.00),(0.55, 0.00, 1.00),(0.60, 0.00, 1.00),(0.65, 0.00, 1.00),(0.70, 0.00, 1.00),(0.75, 0.00, 1.00),(0.80, 0.00, 1.00),(0.85, 0.00, 1.00),(0.90, 0.00, 1.00),(0.95, 0.00, 1.00)
23+
]
24+
25+
while x < 1000:
26+
idx = int(c)
27+
color = colors[idx]
28+
turtle.color(color)
29+
turtle.forward(x)
30+
turtle.right(98)
31+
x = x + 1
32+
c = c + 0.1
33+
34+
turtle.exitoncl

0 commit comments

Comments
 (0)