File tree 3 files changed +41
-28
lines changed
3 files changed +41
-28
lines changed Original file line number Diff line number Diff line change 1
- import turtle
2
- a = turtle .Turtle ()
3
- a .getscreen ().bgcolor ("black" )
4
-
5
- a .penup ()
6
- a .goto (- 200 , 100 )
7
- a .pendown ()
8
- a .color ("yellow" )
9
-
10
- a .speed (25 )
11
-
12
-
13
- def star (turtle , size ):
14
- if size <= 10 :
15
- return
16
- else :
17
- turtle .begin_fill ()
18
- for i in range (5 ):
19
- turtle .forward (size )
20
- star (turtle , size / 3 )
21
- turtle .left (216 )
22
- turtle .end_fill ()
23
-
24
-
25
- star (a , 360 )
1
+ import turtle
2
+ a = turtle .Turtle ()
3
+ a .getscreen ().bgcolor ("black" )
4
+
5
+ a .penup ()
6
+ a .goto (- 200 , 100 )
7
+ a .pendown ()
8
+ a .color ("yellow" )
9
+
10
+ a .speed (25 )
11
+
12
+
13
+ def star (turtle , size ):
14
+ if size <= 10 :
15
+ return
16
+ else :
17
+ turtle .begin_fill ()
18
+ for i in range (5 ):
19
+ turtle .forward (size )
20
+ star (turtle , size / 3 )
21
+ turtle .left (216 )
22
+ turtle .end_fill ()
23
+
24
+
25
+ star (a , 360 )
26
26
turtle .done ()
Original file line number Diff line number Diff line change 1
1
# Python-Star
2
- a simple python code that draw a cool Star on the screen
3
2
4
-
5
- A simple file and simple that was interesting to me.
3
+ This repository includes some interesting python files
Original file line number Diff line number Diff line change
1
+ import turtle
2
+ t = turtle .Turtle ()
3
+ s = turtle .Screen ()
4
+ s .bgcolor ('black' )
5
+ t .speed (10 )
6
+ col = ['yellow' , 'blue' , 'white' , 'green' ]
7
+ c = 0
8
+ for i in range (100 ):
9
+ t .forward (i * 10 )
10
+ t .right (144 )
11
+ t .color (col [c ])
12
+ if c == 3 :
13
+ c = 0
14
+ else :
15
+ c += 1
You can’t perform that action at this time.
0 commit comments