#pragma once

#include <stdint.h>

#define MAX_SIZE 32

typedef struct {
    uint8_t x;
    uint8_t y;
    uint8_t n;
} Move;

typedef struct {
    int size; // even, 4..24 
    uint8_t cells[MAX_SIZE][MAX_SIZE];
    int pair_count;
} Board;

void board_copy(Board *dst, const Board *src);
int board_compute_pairs(const Board *b);
int board_max_pairs(const Board *b);
void board_apply_move(Board *b, const Move *m);
