tile.py tile_grid.py drawtiles.py

Yes, I'll use docstrings because I can type more comments between """ and """.
I'll still use # to the right of code to comment on the code line.
This commit is contained in:
njmason2
2025-09-12 10:48:16 -04:00
parent 22a88592cc
commit 59b8557101
2 changed files with 24 additions and 15 deletions

View File

@@ -8,9 +8,13 @@ from turtle import *
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.
"""Draws a (width * height) grid, with tile_function drawn on each tile.
(Your explanation here.)
(nested loops - inner loop draws one complete row (width), inner loop closes,
outer loop positions the pen's return to row starting point,
then moves pen up along height to start a new row.)
-- (fly(tile_size) positions the pen in the next column (width) to the right
to draw the next tile in each row)
"""
for y in range(height):
for x in range(width):
@@ -37,6 +41,3 @@ def move_up_one_row(tile_size):
right(90)