
Envoyé par
fonction
Private Function LesVoisins(ByVal Ind As Integer) As Integer
Dim col As Integer
Dim lig As Integer
Dim CouleurInd As Long
col = colonne(Ind)
lig = ligne(Ind)
CouleurInd = agent(Ind).BackColor
'MsgBox "INDICE: " & Ind & " COONNE: " & Col & " LIGNE:" & Lig
If MemeCouleur(lig + 1, col + 1, CouleurInd) Then LesVoisins = LesVoisins + 1
If MemeCouleur(lig + 1, col, CouleurInd) Then LesVoisins = LesVoisins + 1
If MemeCouleur(lig + 1, col - 1, CouleurInd) Then LesVoisins = LesVoisins + 1
If MemeCouleur(lig - 1, col + 1, CouleurInd) Then LesVoisins = LesVoisins + 1
If MemeCouleur(lig - 1, col, CouleurInd) Then LesVoisins = LesVoisins + 1
If MemeCouleur(lig - 1, col - 1, CouleurInd) Then LesVoisins = LesVoisins + 1
If MemeCouleur(lig, col + 1, CouleurInd) Then LesVoisins = LesVoisins + 1
If MemeCouleur(lig, col - 1, CouleurInd) Then LesVoisins = LesVoisins + 1
End Function
Partager