generated from mwc/lab_iteration
I created a new tile pattern and explained how
draw_tile_grid works. Checkpoint 3: I probably would use docstrings. I like to break up my work into small bits. Having docstrings to quickly remind myself of what I've written should do would be helpful. Additionally, if I'm working with or showing my work to someone else, it'd be helpful for them to know what the things I'm writing should do.
This commit is contained in:
parent
34ca650305
commit
e5ce11b690
Binary file not shown.
Binary file not shown.
25
tile.py
25
tile.py
|
@ -10,14 +10,31 @@ def draw_tile_outline(size):
|
|||
square(size)
|
||||
|
||||
def draw_squiggle(size):
|
||||
forward(size/4)
|
||||
pencolor("black")
|
||||
left(90)
|
||||
quarter_arc_right(size/4)
|
||||
quarter_arc_left(size/4)
|
||||
quarter_arc_right(size/2)
|
||||
quarter_arc_left(size/2)
|
||||
left(90)
|
||||
forward(size/2)
|
||||
quarter_arc_left(size/4)
|
||||
quarter_arc_right(size/4)
|
||||
left(90)
|
||||
forward(size/2)
|
||||
left(90)
|
||||
forward(size/2)
|
||||
left(90)
|
||||
quarter_arc_right(size/4)
|
||||
quarter_arc_left(size/4)
|
||||
forward(size/2)
|
||||
left(90)
|
||||
forward(3*size/4)
|
||||
#forward(size/4)
|
||||
#pencolor("black")
|
||||
#left(90)
|
||||
#quarter_arc_right(size/4)
|
||||
#quarter_arc_left(size/4)
|
||||
#quarter_arc_left(size/4)
|
||||
#quarter_arc_right(size/4)
|
||||
#left(90)
|
||||
fly(size/4)
|
||||
left(90)
|
||||
fly(size)
|
||||
|
|
|
@ -10,7 +10,10 @@ 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 function draws the grid by drawing the bottom-most row.
|
||||
The width is the number of tiles within a row.
|
||||
It creates a full row before creating the row above.
|
||||
The height is the number of rows.
|
||||
"""
|
||||
for y in range(height):
|
||||
for x in range(width):
|
||||
|
|
Loading…
Reference in New Issue