Setting up the visual layout
The placement of the cells on the screen is interesting. It may seem natural
to use a two-dimension array for the tic-tac-toe board, but the nested loop
structure can be cumbersome on such a small data structure, and treating the
board as a 2D array doesn’t provide many benefits. Instead, I build this as a
single-dimension array and use some tricks to get the visual appearance I want.