Skip to content

Commit b57ef0d

Browse files
author
DirDraggo
committed
added more code
1 parent ab05540 commit b57ef0d

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
speed(0)
2+
penup()
3+
length=0
4+
def move_to_position():
5+
penup()
6+
backward(25)
7+
right(90)
8+
forward(25)
9+
left(90)
10+
def make_square():
11+
pendown()
12+
for i in range(4):
13+
forward(length)
14+
left(90)
15+
penup()
16+
while length < 400:
17+
penup()
18+
make_square()
19+
move_to_position()
20+
length = length + 50
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
speed(0)
2+
setposition(-200,-200)
3+
def make_square(color_square):
4+
color(color_square)
5+
begin_fill()
6+
for i in range(4):
7+
forward(40)
8+
left(90)
9+
end_fill()
10+
def make_row(first_color, second_color):
11+
mod_check=0
12+
for i in range(10):
13+
if mod_check%2==0:
14+
make_square(first_color)
15+
else:
16+
make_square(second_color)
17+
forward(40)
18+
mod_check=mod_check+1
19+
def up_a_row():
20+
penup()
21+
backward(400)
22+
left(90)
23+
forward(40)
24+
right(90)
25+
def make_two_rows():
26+
make_row("red", "black")
27+
up_a_row()
28+
make_row("black", "red")
29+
def make_checkerboard():
30+
for i in range(5):
31+
make_two_rows()
32+
up_a_row()
33+
make_checkerboard()
34+

0 commit comments

Comments
 (0)