Is there a more efficient way to compare shapes in an array than multiple If statements please? i.e. patterns are a bit like chess Knight moves.
A few of the 18 tests are shown as example and take account of edges and corners of the grid by use of col/row tests first.
A few of the 18 tests are shown as example and take account of edges and corners of the grid by use of col/row tests first.
B4X:
If col>3 AND row>3 Then
If aGrid(col,row,0)=aGrid(col-1,row,0) AND aGrid(col,row,0)=aGrid(col-1,row-1,0) Then
aDel(1,2)=True : aDel(1,1)=True
End If
If aGrid(col,row,0)=aGrid(col,row-1,0) AND aGrid(col,row,0)=aGrid(col-1,row-1,0) Then
aDel(2,1)=True : aDel(1,1)=True
End If
If aGrid(col,row,0)=aGrid(col,row-1,0) AND aGrid(col,row,0)=aGrid(col-1,row,0) Then
aDel(2,1)=True : aDel(1,2)=True
End If
End If
'Tests 5-6-17
If col<12 AND row<12 Then
If aGrid(col,row,0)=aGrid(col+1,row,0) AND aGrid(col,row,0)=aGrid(col+1,row+1,0) Then
aDel(3,2)=True : aDel(3,3)=True
End If
If aGrid(col,row,0)=aGrid(col,row+1,0) AND aGrid(col,row,0)=aGrid(col+1,row+1,0) Then
aDel(2,3)=True : aDel(3,3)=True
End If
If aGrid(col,row,0)=aGrid(col,row+1,0) AND aGrid(col,row,0)=aGrid(col+1,row,0) Then
aDel(2,3)=True : aDel(3,2)=True
End If
End If