# Homework 32, problem 3: grid. # # Draw a 4x4 grid of cells covering the window. Use nested for loops to # calculate each cell's position. All cells can be the same colour, # but draw their outlines (use a positive thickness argument) so you can # see the grid lines. # # Run with: python exercises/32/homework/03-grid.py import pygame pygame.init() screen = pygame.display.set_mode((800, 600)) pygame.display.set_caption("Grid") clock = pygame.time.Clock() running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False screen.fill((30, 30, 30)) # TODO: draw the grid here with nested for loops pygame.display.flip() clock.tick(60) pygame.quit()