Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unique Solutions
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00109528
Message ID:
00109557
Vues:
39
>I have a 5 X 5 grid with each cell having a value of 1 or 0 depending on whether the cell is 'active' or 'inactive'. If 5 cells are active consecutively then it forms a row or column whichever the case may be. Under these conditioins there are 13 possible situations to take into account: 5 rows, 5 columns, 2 diagonals and the four corners plus the center square. I need to find a solution to determine which two are active or three or four for that matter without having to check something like if A = 1 and B =1, if A = 1 and C = 1, and so on....any ideas?
>
>Thanks.

why not 5 x 5 array? sum for row, col, and diagonals should be 5 and easy to 'loop'.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform