Files
lab_iteration/tile.py
erbrown 3389e50b00 Created a line in the title by creating a function and moving the turtle foward and back. I took out the squiggle function.
Checkpoint 3: Yes I do think I will use docstrings as it will help me provide space to write explain the meaning of the code along with what it is doing. They can be very useful.
2025-09-15 21:15:18 -04:00

32 lines
594 B
Python

from turtle import *
def draw_tile(size):
"Draws one tile, which can be repeated to form a pattern."
draw_tile_outline(size)
draw_stripe(size)
def draw_tile_outline(size):
pencolor("#dddddd")
square(size)
def draw_stripe(size):
pencolor("black")
fly(size/4)
left(90)
forward(size)
backward(size)
right(90)
fly(-size/4)
def fly(distance):
"Moves without drawing."
penup()
forward(distance)
pendown()
def square(size):
"Draws a square of side length `size`"
for side in range(4):
forward(size)
left(90)