From 49db8a57a8bc2930116d4f9dce6ddb996af487b9 Mon Sep 17 00:00:00 2001 From: angelotr Date: Sun, 14 Sep 2025 23:31:17 -0400 Subject: [PATCH] A few changes I did in tile.py was I added color to my draw_tile() function and added a sqwiggle to make my tile unique. This made a cross pattern tile with a sqwiggle inside the tile. Checkpoint 3: When writing my own programs I think I would try to use docstrings more. When writing programs I normally use the hashtag which has become muscle memory for me but I will try to use docstring because it looks cleaner and more effective. --- tile.py | 15 +++++++++++++++ tile_grid.py | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tile.py b/tile.py index 697cf8e..6591fe2 100644 --- a/tile.py +++ b/tile.py @@ -2,8 +2,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) + pencolor("red") + forward(size/2) + left(90) + forward(size) + backward(size/2) + left(90) + forward(size/2) + backward(size) + left(90) + + def draw_tile_outline(size): pencolor("#dddddd") @@ -42,3 +54,6 @@ def quarter_arc_right(radius): def quarter_arc_left(radius): "Draws a quarter of an arc, turning to the left." circle(radius, 90) + +draw_tile(100) +done() diff --git a/tile_grid.py b/tile_grid.py index 72a0f43..fae2520 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.) + The draw_tile_grid function draws a grid of tiles by repeatedly calling a given tile-drawing function across each row and column, moving the turtle to the correct position after each tile and row until the whole grid is complete. """ for y in range(height): for x in range(width):