I am writing a tic-tac-toe game in Java.
I have a 2D array representing a 3-by-3 grid, and need a method to check if there are 2 bits set in such a way that a row of 3 can be formed by adding a third bit.
The only way I could think of doing this is to iterate along the rows, checking for a blank space, then checking the bits around it, but this is potentially messy and confusing piece of code.
Any hints and advice are appreciated!