Skip to content

Commit d4a1f72

Browse files
committed
Added challange 2.19.6
1 parent 5241910 commit d4a1f72

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

CodeHS/2/19/6/checkerboard.py

+29
Original file line numberDiff line numberDiff line change
@@ -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+
forward(square_width)
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+
left(90)
28+
forward(square_width * (colum + 1))
29+
right(90)

0 commit comments

Comments
 (0)