import pygame import sys DIMENSION = 8 SQ_SIZE = 800 // DIMENSION MAX_FPS = 20 IMAGES = {} # Load images for i in range(1, 13): filename = 'images/b{}'.format(i) img = pygame.image.load(filename) IMAGES[filename] = img for i in range(1, 13): filename = 'images/w{}'.format(i) img = pygame.image.load(filename) IMAGES[filename] = img # Set up some colors BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (255, 0, 0) # Set up the board board = [[0] * DIMENSION for _ in range(DIMENSION)] create_board(board) # Set up some variables valid_moves = [] player_clicks = [] game_over = False # Set up the clock clock = pygame.time.Clock() def on_board(pos): """ Check if a position is on the board. """ (row, col) = pos return 0 <= row < DIM