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

This commit is contained in:
2025-01-05 11:12:59 +01:00
parent e35123e9fe
commit 8945072074
3 changed files with 7 additions and 7 deletions

View File

@@ -34,7 +34,7 @@ public class App {
sudoku.getGrille().setCase(0, 7, Symbole.of(8));
sudoku.getGrille().setCase(4, 8, Symbole.of(9));
sudoku.getGrille().createSquareBlocs();
sudoku.getGrille().creerBlocCarre();
System.out.println("Sudoku :");
System.out.println(sudoku.getGrille().toString());

View File

@@ -10,7 +10,7 @@ public class Bloc {
this.cases = new ArrayList<>();
}
public void addCase(Case c) {
public void ajouterCase(Case c) {
cases.add(c);
}

View File

@@ -46,7 +46,7 @@ public class Grille {
* Crée un bloc à partir des positions spécifiées
*
* Exemple :
* sudoku.getGrille().createBloc(Arrays.asList(
* sudoku.getGrille().creerBloc(Arrays.asList(
* new int[] { 0, 0 },
* new int[] { 0, 1 },
* new int[] { 0, 2 },
@@ -60,16 +60,16 @@ public class Grille {
* @param positions
* @return
*/
public Bloc createBloc(List<int[]> positions) {
public Bloc creerBloc(List<int[]> positions) {
Bloc bloc = new Bloc();
for (int[] pos : positions) {
bloc.addCase(cases[pos[0]][pos[1]]);
bloc.ajouterCase(cases[pos[0]][pos[1]]);
}
blocs.add(bloc);
return bloc;
}
public void createSquareBlocs() {
public void creerBlocCarre() {
try {
int blocSize = (int) Math.sqrt(taille);
if (blocSize * blocSize != taille) {
@@ -83,7 +83,7 @@ public class Grille {
positions.add(new int[] { i + k, j + l });
}
}
createBloc(positions);
creerBloc(positions);
}
}
} catch (IllegalArgumentException e) {