-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcool scribble.py
More file actions
31 lines (26 loc) · 839 Bytes
/
cool scribble.py
File metadata and controls
31 lines (26 loc) · 839 Bytes
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
import turtle
t = turtle.Turtle()
s = turtle.Screen()
s.bgcolor("pink")
t.pencolor("aqua")
width = 0 # Starting width of the rectangle
height = 0 # Starting height of the rectangle
t.speed(0)
t.penup()
t.goto(-970, 530) # Start from the top-left corner
t.pendown()
t.fillcolor("aqua")
t.shape("turtle")
t.pensize(5)
while True:
for _ in range(2): # Draw two pairs of sides for the rectangle
t.forward(width) # Move forward by the width
t.right(10) # Turn 90 degrees
t.forward(height) # Move forward by the height
t.right(90) # Turn 90 degrees again
width += 14 # Increase the width of the rectangle
height += 9 # Increase the height of the rectangle (slower growth)
if width > 2000: # Stop once the width reaches a certain size
break
t.hideturtle()
turtle.done()