Hi,
ok, your array will work with indexes so let's assume the following:
index : Id
0 A1
1 A2
2 A3
3 A4
4 B1
5 B2
6 B3
7 B4
... etc
and now you will create a global array of bools, where if let's say index 5 is true, that means B2 is red
does that make sense? what your board need to do is to raise and lower boolean values in that array depending on where the user click.
now, to check your situation you need to verify that index 0,1,4 and 5 are true, and that no other are false.
to do this in a clever way, you will have an fsm with an array of ints, representing the grid indexes to check for a valid pattern, in our case:
{0,1,4,5}
and your fsm will loop trough all indexes, and check if the current index is found within your pattern array, and if it is, it must be true, else it must be false.
during that loop, if a index is not of the expected value, you fail the pattern, else when the loop as ended all all indexes matched that pattern, you can assume you have exactly that pattern on the board.
Does that sound ok? the great thing about the pattern array, is that you can now define a lot of different patterns and check them with the same routine!
Bye,
Jean