repl.it
@Bookie0/

shooting stars

Python (with Turtle)

No description

fork
loading
main.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

from random import randint
import turtle

window = turtle.Screen()
window.colormode(255)
pen.speed(0)




def rand_color():
    pen.color(randint(0, 255), randint(0, 255), randint(0, 255))



def spiral(turns):
    count = 0
    while count < turns:
        
        pen.forward((count + 1) * 3)
        pen.left (91)
        
        count += 1
        
def sprinkles(size):
    rand_color()
    pen.forward(size)
    
    
def star(size):
    count = 0
    while count < 5:
        rand_color()
        turtle.forward(size)
        turtle.right(144)
        count += 1
    



count = 0 
while count < 100:
    size = randint(20, 40)
    x = randint (-300, 300)
    y = randint (-300, 300)
    pen.penup()
    pen.setpos(x, y)
    pen.pendown()
    turns = randint(9, 19)
    rand_color()
    sprinkles(size)
    
    if count % 4 == 0:
       star(size)
    count += 1














window.exitonclick()


result
console
?