Try using an array to represent the information on the grid. For example, in a 5x5 array, have white diamonds represented by 1 and black diamonds represented by 2.
For each specific arrangement you are interested in, use "For each element" to create a set of conditions to check.
Ex: Line of 3 white diamonds and a black diamond
Array - For Each XY Element
Array.CurValue = 1
Array.At(Array.CurX+1,Array.CurY)=1
Array.At(Array.CurX+2,Array.CurY)=1
Array.At(Array.CurX+3,Array.CurY)=2
You can also use "black" and "white" as a string in the array, but numbers are usually easier to deal with.