import time
BOARD_SIZE = 8
TIMER_LIMIT = 20 * 60 # 20 minutes in seconds
# Sample operation grid for each cell: standard Damath setup
OPERATION_GRID = [
['+', '-', 'x', '÷', '+', '-', 'x', '÷'],
['-', 'x', '÷', '+', '-', 'x', '÷', '+'],
['x', '÷', '+', '-', 'x', '÷', '+', '-'],
['÷', '+', '-', 'x', '÷', '+', '-', 'x'],
['+', '-', 'x', '÷', '+', '-', 'x', '÷'],
['-', 'x', '÷', '+', '-', 'x', '÷', '+'],
['x', '÷', '+', '-', 'x', '÷', '+', '-'],
['÷', '+', '-', 'x', '÷', '+', '-', 'x']
]
# Board contains either None or a tuple (player, value)
# Player: 'A' or 'B'; value: 0 or 1
def initialize_board():
board = [[None for _ in range(BOARD_SIZE)] for _ in range(BOARD_SIZE)]
# Place binary pieces for Player A (top)
for row in range(3):
for col in range(BOARD_SIZE):
if (row + col) % 2 == 1:
board[row][col] = ('A', (row + col) % 2) # Alternatin