# Homework 32, challenge: chessboard. # # Draw an 8x8 chessboard. Squares at positions where (row + col) % 2 == 0 # are light; the rest are dark. Use nested for loops. The board should fill # the window neatly. # # Run with: python exercises/32/homework/04-chessboard.py import pygame pygame.init() screen = pygame.display.set_mode((600, 600)) pygame.display.set_caption("Chessboard") clock = pygame.time.Clock() running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False screen.fill((0, 0, 0)) # TODO: draw the board here with nested for loops pygame.display.flip() clock.tick(60) pygame.quit()