Skip to content

Instantly share code, notes, and snippets.

@snwfdhmp
Created June 4, 2017 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snwfdhmp/1c1cc01128595104f7d1c3617b399a6b to your computer and use it in GitHub Desktop.
Save snwfdhmp/1c1cc01128595104f7d1c3617b399a6b to your computer and use it in GitHub Desktop.
Fonction qui dit si la partie est terminée ou non
//à caser où tu veux
//dépendances : MovePlan, Emplacement
bool isOver(Emplacement grille[TAILLE][TAILLE]) {
MovePlan tmp;
int x,y,k,l;
for (x = 0; x < TAILLE; ++x)
for (y = 0; y < TAILLE; ++y)
if(grille[x][y].valeur == 2)
continue;
else
for (k = -1; k <= 1; ++k)
for (l = -1; l <= 1; ++l)
if(tmp.init(x, y, x+l, y+k, team, grille) != -1)
return false;
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment