feat: add error handling for unsolvable Sudoku and rename test class for clarity
This commit is contained in:
@@ -5,9 +5,9 @@ import org.junit.jupiter.api.Test;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class TestCreationGrille {
|
||||
public class TestCreationGrilleRectangulaireSansSolution {
|
||||
@Test
|
||||
public void testLigne() {
|
||||
public void testCreationGrilleSansSolution() {
|
||||
// CREATION D'UN SUDOKU SIMPLE 12*12
|
||||
Sudoku sudoku = new Sudoku(12);
|
||||
sudoku.getGrille().setSymbolesPossibles(new ArrayList<>(Arrays.asList(
|
||||
@@ -98,6 +98,12 @@ public class TestCreationGrille {
|
||||
sudoku.getGrille().printBlocs();
|
||||
System.out.println("Symboles possibles :");
|
||||
sudoku.getGrille().printSymbolesPossibles();
|
||||
|
||||
ResolveurBacktraceSimple resolveur = new ResolveurBacktraceSimple();
|
||||
boolean solved = resolveur.resoudre(sudoku, false);
|
||||
System.out.println("Sudoku " + (solved ? "résolu" : "non résolu") + " :");
|
||||
System.out.println(sudoku.getGrille().toString());
|
||||
|
||||
System.out.println("FIN TEST LIGNE");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user