i changed the squiggle

This commit is contained in:
ilmabura
2025-09-21 11:24:29 -04:00
parent 0df5838eb4
commit 512a02d0da
3 changed files with 15 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ from tile_grid import draw_tile_grid
from superturtle.movement import no_delay
from argparse import ArgumentParser
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("height", type=int, help="How many tiles high the grid should be")

17
tile.py
View File

@@ -10,14 +10,19 @@ def draw_tile_outline(size):
square(size)
def draw_squiggle(size):
left(90)
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)
right(90)
quarter_arc_right(size/8)
quarter_arc_left(size/8)
quarter_arc_left(size/8)
quarter_arc_right(size/8)
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)
left(90)
fly(size)

View File

@@ -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.)
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 x in range(width):