diff --git a/tile.py b/tile.py index 697cf8e..abf0fd8 100644 --- a/tile.py +++ b/tile.py @@ -3,25 +3,20 @@ 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_stripe(size) def draw_tile_outline(size): pencolor("#dddddd") square(size) -def draw_squiggle(size): - forward(size/4) +def draw_stripe(size): 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) + forward(size) + backward(size) + right(90) + fly(-size/4) def fly(distance): "Moves without drawing." @@ -34,11 +29,3 @@ def square(size): for side in range(4): forward(size) left(90) - -def quarter_arc_right(radius): - "Draws a quarter of an arc, turning to the right." - circle(-radius, 90) - -def quarter_arc_left(radius): - "Draws a quarter of an arc, turning to the left." - circle(radius, 90) diff --git a/tile_grid.py b/tile_grid.py index 72a0f43..9c823dc 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.) + (You give it a grid width, height, size(length) and function that does the drawing. It draws tiles goes to the left moves up a row and repeats all the rows from the height and width. The turtle then ends at the starting point.) """ for y in range(height): for x in range(width):