Question: I have coded a game in C that takes a 2D array as a board. The board is offset so that each tile has 6
I have coded a game in C that takes a 2D array as a board. The board is offset so that each tile has 6 boardering tiles as follows:

The point of the game for one player to get from left to right and the 2nd player to get from top to bottom...know as the game HEX.
Currently it is an int array that holds 0 for player O and 1 for player X and 2 for( ',') unused tiles.
There is computer players or human players. The placing process is done by inside a while loop that will exit once parameters of a win are met.
I am seeking some guidance on how to step through a test for a win, making sure the test is not caught in a loop if the tiles form a 'loop' in the array. How could I go about this?
Thanks for any advice you can give.
Player X> 2 2 Player X> 2 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
