generated from mwc/lab_iteration
	I changed the pattern of the tiles and added the docstring to the function.
Checkpoint 3: - I will definitely use docstrings in the future. I will use them because they are helpful in showing another person what each function does. Also, when I am debugging my code it will be helpful if I know what each function is supposed to be doing.
This commit is contained in:
		
							
								
								
									
										5
									
								
								tile.py
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								tile.py
									
									
									
									
									
								
							@@ -4,6 +4,11 @@ def draw_tile(size):
 | 
				
			|||||||
    "Draws one tile, which can be repeated to form a pattern."
 | 
					    "Draws one tile, which can be repeated to form a pattern."
 | 
				
			||||||
    draw_tile_outline(size)
 | 
					    draw_tile_outline(size)
 | 
				
			||||||
    draw_squiggle(size)
 | 
					    draw_squiggle(size)
 | 
				
			||||||
 | 
					    draw_squiggle(size/2)
 | 
				
			||||||
 | 
					    draw_squiggle(size/3)
 | 
				
			||||||
 | 
					    draw_squiggle(size/4)
 | 
				
			||||||
 | 
					    draw_squiggle(size/5)
 | 
				
			||||||
 | 
					    draw_squiggle(size/6)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def draw_tile_outline(size):
 | 
					def draw_tile_outline(size):
 | 
				
			||||||
    pencolor("#dddddd")
 | 
					    pencolor("#dddddd")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,7 @@ from tile import fly
 | 
				
			|||||||
def draw_tile_grid(width, height, tile_size, tile_function):
 | 
					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 x height) grid, with tile_function drawn on each tile.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    (Your explanation here.)
 | 
					    Line 15 will loop through numbers 0 to the height you give it and save it as y.  Line 16 will loop through numbers 0 to the width you give it and save it as x.  The rest of the function will make the tiles then go back to the starting point.  Then to make more tiles it will use move_up_one_row and continue to make them until the necessary amount of tiles are made.
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    for y in range(height):
 | 
					    for y in range(height):
 | 
				
			||||||
        for x in range(width):
 | 
					        for x in range(width):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user