I have created a 3x3 matrix for a tic tac toe game that stores the condition of the gameboard . Each cell stores the value 1 if the particular place of the board is occupied with a circle or 2 if it's occupied with an X. What's the best way to determine the winner as in best way to traverse the matrix and find where there are 3 consecutive symbols of a kind ?