Suppose I am designing a game of tic-tac-toe game playing in an infinite board. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row wins. What is the best data structure to represent it? I can only think of hash table to record positions. For each new position, check its surroundings are checked to evaluate a win.
Any other better idea?