Squashed commit of the following:

commit 862ff6e08d
Author: Morph01 <thibaut6969delastreet@gmail.com>
Date:   Mon Jan 20 12:49:38 2025 +0100

    feat: affichage de la grille colorée et vérification de tt les contraintes

commit b1dde68ec1
Author: Morph01 <thibaut6969delastreet@gmail.com>
Date:   Sun Jan 5 11:16:34 2025 +0100

    feat: add constraint management and validation to Sudoku class

commit d8486a3bd7
Author: Morph01 <thibaut6969delastreet@gmail.com>
Date:   Sun Jan 5 11:13:19 2025 +0100

    feat: implement constraint classes for Sudoku (row, column, block)

commit 8945072074
Author: Morph01 <thibaut6969delastreet@gmail.com>
Date:   Sun Jan 5 11:12:59 2025 +0100

    refactor: rename methods to French for consistency in the Sudoku application

commit e35123e9fe
Author: Morph01 <thibaut6969delastreet@gmail.com>
Date:   Sun Jan 5 11:11:40 2025 +0100

    fix: update build.gradle to use testRuntimeOnly for JUnit Jupiter engine
This commit is contained in:
2025-01-20 12:53:23 +01:00
parent 22e88a899f
commit 3586ae4c15
15 changed files with 372 additions and 74 deletions

View File

@@ -0,0 +1,19 @@
package sudoku;
import sudoku.core.Console;
public class ContrainteColonne implements Contrainte {
@Override
public boolean estRespectee(Grille grille, Case c) {
int colonne = c.getColonne();
Symbole symbole = c.getSymbole();
for (int ligne = 0; ligne < grille.getTaille(); ligne++) {
Case currentCase = grille.getCase(ligne, colonne);
if (currentCase != c && currentCase.getSymbole() != null && currentCase.getSymbole().equals(symbole)) {
Console.errorln("La contrainte de colonne n'est pas respectee: ligne=" + ligne + ", col=" + colonne + ", symbole=" + symbole);
return false;
}
}
return true;
}
}