How should I implement my 2d Dots and Boxes game?


I am currently implementing part of my 2d game where players have to solve some puzzles similar to the traditional “Dots and Boxes” game. The players take turn clicking on each border of a box and the player who clicks the last border of the box gets it, etc. I’d imagine I need to use a game object for each line to handle different line color based on who picked it. But with the board 6x6 boxes I don’t know if making each line, say with a GUI button, would the best idea.

How should I implement something like this? Can someone shed me some light on this so I know where to start? Thank you so much!

As with pretty much anything, it’s always good to think of what the objects/concepts are, the attributes they have, and the actions they can take or have done to them. Player, Dot, Connection, Box… Either a 2-dimensional array of Dot objects, or a List where each Dot has an X and Y coordinate. A List where a new Connection is added each turn, and a List similar to the dots each with an owner (or none). Every time a player creates a connection, check the box ownership logic (the hard part).