add possible improvement
This commit is contained in:
parent
f80c7f340b
commit
882fe8a27b
1 changed files with 13 additions and 0 deletions
|
@ -29,6 +29,8 @@ void _affiche_lettres(void) {
|
|||
}
|
||||
|
||||
void affiche_plateau(Jeton *plat[LONGEUR][LARGEUR]) {
|
||||
// TODO: Instead of print instantly, store everything in a table and print
|
||||
// the whole thing once?
|
||||
_affiche_lettres();
|
||||
|
||||
for (int i = 0; i < LONGEUR * 2 + 1; ++i) {
|
||||
|
@ -58,3 +60,14 @@ void affiche_plateau(Jeton *plat[LONGEUR][LARGEUR]) {
|
|||
|
||||
_affiche_lettres();
|
||||
}
|
||||
|
||||
int plateau_rempli(Jeton *plat[LONGEUR][LARGEUR]) {
|
||||
for (int i = 0; i < LONGEUR; ++i) {
|
||||
for (int j = 0; j < LARGEUR; ++j) {
|
||||
if (plat[i][j]->couleur == VIDE)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Reference in a new issue