Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
941 B
1
Indexable
Never
def draw_row_1():
    for i in range(5):
        color("red")
        begin_fill()
        for i in range(4):
            forward(40)
            left(90)
        end_fill()
        penup()
        forward(40)
        color("black")
        begin_fill()
        for i in range(4):
            forward(40)
            left(90)
        end_fill()
        forward(40)

def draw_row_2():
    for i in range(5):
        color("black")
        begin_fill()
        for i in range(4):
            forward(40)
            left(90)
        end_fill()
        penup()
        forward(40)
        color("red")
        begin_fill()
        for i in range(4):
            forward(40)
            left(90)
        end_fill()
        forward(40)   

def move_row():
    penup()
    right(90)
    forward(40)
    left(90)
    backward(400)

speed(0)
penup()
goto(-200, 160)
for i in range(10):
    draw_row_1()
    move_row()
    draw_row_2()
    move_row()
Leave a Comment