diff --git a/__pycache__/tile.cpython-312.pyc b/__pycache__/tile.cpython-312.pyc new file mode 100644 index 0000000..4ca064f Binary files /dev/null and b/__pycache__/tile.cpython-312.pyc differ diff --git a/__pycache__/tile_grid.cpython-312.pyc b/__pycache__/tile_grid.cpython-312.pyc new file mode 100644 index 0000000..4e2d064 Binary files /dev/null and b/__pycache__/tile_grid.cpython-312.pyc differ diff --git a/tile.py b/tile.py index 697cf8e..fb93381 100644 --- a/tile.py +++ b/tile.py @@ -3,22 +3,25 @@ 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_fancysquiggle(size) def draw_tile_outline(size): pencolor("#dddddd") square(size) -def draw_squiggle(size): - forward(size/4) - pencolor("black") +def draw_fancysquiggle(size): + pencolor("blue") left(90) - quarter_arc_right(size/4) - quarter_arc_left(size/4) - quarter_arc_left(size/4) - quarter_arc_right(size/4) + half_arc_right(size/2) + left(180) + fly(size/2) left(90) - fly(size/4) + fly(size/2) + right(90) + pencolor("red") + forward(size/2) + left(90) + fly(size/2) left(90) fly(size) left(90) @@ -35,10 +38,10 @@ def square(size): forward(size) left(90) -def quarter_arc_right(radius): - "Draws a quarter of an arc, turning to the right." - circle(-radius, 90) +def half_arc_right(radius): + "Draws a half of an arc, turning to the right." + circle(-radius, 180) -def quarter_arc_left(radius): - "Draws a quarter of an arc, turning to the left." - circle(radius, 90) +def half_arc_left(radius): + "Draws a half of an arc, turning to the left." + circle(radius, 180) diff --git a/tile_grid.py b/tile_grid.py index 72a0f43..80fc6fd 100644 --- a/tile_grid.py +++ b/tile_grid.py @@ -9,8 +9,15 @@ 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.) +takes 4 commands +width is the number of tiles wide as inputted by the user +height is the number of tiles high as inputted by the user +tile_size is the size of the tile as inputted by the user +tile_function is the squiggle on the tile +For y in range(height) and for x in range(width) repeats the tile design for each tile +and then moves back over or up to start drawing another tile until enough tiles +to satisfy the height and width have been drawn + The width (horizontal) tiles are drawn first because they are indented below line 23 """ for y in range(height): for x in range(width):