problemset_typeface/grid.py

18 lines
381 B
Python

from turtle import *
GRID_ROWS = 8
def draw_square(unit):
for i in range(4):
forward(unit)
left(90)
def draw_grid(unit):
"Draws a grid, with `unit` as the spacing."
for cycle in range(2):
for i in range(GRID_ROWS + 1):
draw_square(i * unit)
for side in range(2):
forward(GRID_ROWS * unit)
left(90)