If a pile of matchboxes can learn to play Tic-Tac-Toe, then certainly I should be able to code a solution. With my predilection for databases, T-SQL was my tool of choice. But first, I needed to model the game with some sort of data structure. Unfortunately, as I learned, it’s not as simple as mapping some X and O values to a grid.
Known as Noughts and Crosses across the pond, Tic-Tac-Toe is considered a “solved game“– meaning we can predict the outcome of the game assuming perfect play. In fact, Wikipedia says “it is straightforward to write a computer program to play tic-tac-toe perfectly“. Well then as a programmer, I ought to be able to do it.