I generally come up with some function for converting X-Y coordinate to something useful.
For example, to convert X-Y coordinate of an 8x8 grid to sequential numbers (left to right and top to bottom, 1-64) I’d use:
(x + 1) * (y + 1) + (7 * y) - (x * y) - 1 = index