How to detect winner in Hex Board Game with java?
I’m making a Hex Board Game using Java. Everything is ready, the introduction to the game, the playing field, etc. The only thing left is to determine the winner while the game is being played. I know that I need to use a DFS or BFS algorithm for this, but I can’t do it exactly right. For example, the red color will win when it goes from left to right without interruption, but in the code I wrote, it wins even if there is an interruption. It doesn’t check the path properly. Help me please.