generated from mwc/lab_iteration
i changed the squiggle
This commit is contained in:
@@ -10,6 +10,7 @@ from tile_grid import draw_tile_grid
|
|||||||
from superturtle.movement import no_delay
|
from superturtle.movement import no_delay
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
|
|
||||||
parser = ArgumentParser("python drawtiles.py", description="Draws a grid of tiles.")
|
parser = ArgumentParser("python drawtiles.py", description="Draws a grid of tiles.")
|
||||||
parser.add_argument("width", type=int, help="How many tiles across the grid should be")
|
parser.add_argument("width", type=int, help="How many tiles across the grid should be")
|
||||||
parser.add_argument("height", type=int, help="How many tiles high the grid should be")
|
parser.add_argument("height", type=int, help="How many tiles high the grid should be")
|
||||||
|
|||||||
17
tile.py
17
tile.py
@@ -10,14 +10,19 @@ def draw_tile_outline(size):
|
|||||||
square(size)
|
square(size)
|
||||||
|
|
||||||
def draw_squiggle(size):
|
def draw_squiggle(size):
|
||||||
|
left(90)
|
||||||
forward(size/4)
|
forward(size/4)
|
||||||
pencolor("black")
|
pencolor("black")
|
||||||
left(90)
|
right(90)
|
||||||
quarter_arc_right(size/4)
|
quarter_arc_right(size/8)
|
||||||
quarter_arc_left(size/4)
|
quarter_arc_left(size/8)
|
||||||
quarter_arc_left(size/4)
|
quarter_arc_left(size/8)
|
||||||
quarter_arc_right(size/4)
|
quarter_arc_right(size/8)
|
||||||
left(90)
|
quarter_arc_right(size/8)
|
||||||
|
quarter_arc_left(size/8)
|
||||||
|
quarter_arc_left(size/8)
|
||||||
|
quarter_arc_right(size/8)
|
||||||
|
right(90)
|
||||||
fly(size/4)
|
fly(size/4)
|
||||||
left(90)
|
left(90)
|
||||||
fly(size)
|
fly(size)
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ 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.)
|
draws a grid of tiles of specified dimensions using pattern defined in tile_function.
|
||||||
|
A tile is added to the row until the width is met, then it is increased in height by a tile and another row is complete.
|
||||||
|
once the height is achieved, the grid is complete.
|
||||||
"""
|
"""
|
||||||
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