generated from mwc/lab_iteration
No it wasn't difficult. I used, modified, and (re)
created. I liked ranges I understood how to manipulate them using common denominators and limits. It was easy to play around with and see how each range changed based on my input. Yes, I will use it in the future because it basically reiterates what was explained in the function and provides more precise instructions on what was manipulated
This commit is contained in:
parent
c0f1360969
commit
c5c231bc75
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,21 @@
|
|||
from turtle import *
|
||||
|
||||
def square(side_length):
|
||||
forward(side_length)
|
||||
right(90)
|
||||
forward(side_length)
|
||||
right(90)
|
||||
forward(side_length)
|
||||
right(90)
|
||||
forward(side_length)
|
||||
right(90)
|
||||
sizes = [20,40,60,80,100]
|
||||
for size in sizes:
|
||||
square(size)
|
||||
for size in sizes:
|
||||
square(20)
|
||||
penup()
|
||||
forward(40)
|
||||
pendown()
|
||||
input()
|
||||
|
2
tile.py
2
tile.py
|
@ -11,7 +11,7 @@ def draw_tile_outline(size):
|
|||
|
||||
def draw_squiggle(size):
|
||||
forward(size/4)
|
||||
pencolor("black")
|
||||
pencolor("blue")
|
||||
left(90)
|
||||
quarter_arc_right(size/4)
|
||||
quarter_arc_left(size/4)
|
||||
|
|
|
@ -10,7 +10,9 @@ 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.)
|
||||
(To draw width, moves to x origin then moves up one row to create tile size then returns to the original
|
||||
moves to the right 90 for the width, moves to the left 90 for the height then goes back to the origin
|
||||
and repeats)
|
||||
"""
|
||||
for y in range(height):
|
||||
for x in range(width):
|
||||
|
|
Loading…
Reference in New Issue