generated from mwc/problemset_typeface
	Initial commit
This commit is contained in:
		
							
								
								
									
										17
									
								
								grid.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								grid.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
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)
 | 
			
		||||
		Reference in New Issue
	
	Block a user