generated from mwc/lab_iteration
	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:
		
							
								
								
									
										11
									
								
								tile_grid.py
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								tile_grid.py
									
									
									
									
									
								
							@@ -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)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user