diff --git a/__pycache__/tile.cpython-310.pyc b/__pycache__/tile.cpython-310.pyc new file mode 100644 index 0000000..89ca560 Binary files /dev/null and b/__pycache__/tile.cpython-310.pyc differ diff --git a/__pycache__/tile_grid.cpython-310.pyc b/__pycache__/tile_grid.cpython-310.pyc new file mode 100644 index 0000000..bd95bc3 Binary files /dev/null and b/__pycache__/tile_grid.cpython-310.pyc differ diff --git a/tile.py b/tile.py index 697cf8e..d43e399 100644 --- a/tile.py +++ b/tile.py @@ -3,26 +3,12 @@ from turtle import * def draw_tile(size): "Draws one tile, which can be repeated to form a pattern." draw_tile_outline(size) - draw_squiggle(size) + draw_greater_arc(size) def draw_tile_outline(size): pencolor("#dddddd") square(size) -def draw_squiggle(size): - forward(size/4) - pencolor("black") - left(90) - quarter_arc_right(size/4) - quarter_arc_left(size/4) - quarter_arc_left(size/4) - quarter_arc_right(size/4) - left(90) - fly(size/4) - left(90) - fly(size) - left(90) - def fly(distance): "Moves without drawing." penup() @@ -42,3 +28,13 @@ def quarter_arc_right(radius): def quarter_arc_left(radius): "Draws a quarter of an arc, turning to the left." circle(radius, 90) + +def draw_greater_arc(size): + "Draw a full arc or half of a circle, turning to the left." + pencolor("black") + quarter_arc_left(size/2) + quarter_arc_left(size/2) + left(90) + fly(size) + left(90) + diff --git a/tile_grid.py b/tile_grid.py index 72a0f43..88e0da8 100644 --- a/tile_grid.py +++ b/tile_grid.py @@ -10,7 +10,7 @@ from tile import fly def draw_tile_grid(width, height, tile_size, tile_function): """Draws a (width x height) grid, with tile_function drawn on each tile. - (Your explanation here.) + Uses the tile_size function to create an evenly distributed grid before returning to starting position. """ for y in range(height): for x in range(width):