add possible improvement

This commit is contained in:
Mylloon 2022-11-17 20:53:04 +01:00
parent f80c7f340b
commit 882fe8a27b
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -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;
}