We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5241910 commit d4a1f72Copy full SHA for d4a1f72
CodeHS/2/19/6/checkerboard.py
@@ -0,0 +1,29 @@
1
+"""
2
+This program made by Joe
3
4
+square_width = 40
5
+
6
+speed(0)
7
+def drawModCube(cube_id):
8
+ pendown()
9
+ if (cube_id % 2 == 0):
10
+ color("Red")
11
+ else:
12
+ color("Black")
13
+ begin_fill()
14
+ for i in range(4):
15
+ forward(square_width)
16
+ left(90)
17
+ end_fill()
18
+ penup()
19
20
21
+penup()
22
+setposition(-200,-200)
23
+for colum in range((400 / square_width)):
24
+ for row in range((400 / square_width)):
25
+ drawModCube(row + colum)
26
+ setposition(-200,-200)
27
28
+ forward(square_width * (colum + 1))
29
+ right(90)
0 commit comments