We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 14a78ab commit 63189b9Copy full SHA for 63189b9
CodeHS/2/13/4/Colorful Caterpillar-Joe.py
@@ -1,15 +1,21 @@
1
-def drawCube(side_len):
+numCircles = 8
2
+circleSize = 20
3
+
4
+speed(0)
5
+def make_caterpillar_cell(color_choice, m_size):
6
pendown()
- for i in range(16): # 16 beacuse codehs is dumb
- forward(side_len)
- left(90)
7
+ begin_fill()
8
+ color(color_choice)
9
+ circle(m_size)
10
+ end_fill()
11
penup()
12
+ advance_to_next(m_size)
13
14
+def advance_to_next(m_size):
15
+ penup()
16
+ forward(m_size * 2)
17
18
-setposition(-200, -200)
-for i in range(4):
- square_length = input("Enter square size: ")
- drawCube(square_length)
- forward(400)
-print("Done!")
19
+setposition(-100, 0)
20
+for i in range(numCircles):
21
+ make_caterpillar_cell(input("Color for cell " + str(i + 1) + ": "), circleSize)
0 commit comments