feat: add error handling for unsolvable Sudoku and rename test class for clarity
This commit is contained in:
@@ -2,12 +2,18 @@ package sudoku;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import sudoku.core.Console;
|
||||
|
||||
public class ResolveurBacktraceSimple implements Resolveur {
|
||||
|
||||
@Override
|
||||
public boolean resoudre(Sudoku s, boolean afficherEtape) {
|
||||
EtatResolution etat = new EtatResolution(0, 0);
|
||||
return resoudre(s, afficherEtape, etat);
|
||||
boolean solved = resoudre(s, afficherEtape, etat);
|
||||
if (!solved) {
|
||||
Console.errorln("Ce Sudoku n'a pas de solution");
|
||||
}
|
||||
return solved;
|
||||
}
|
||||
|
||||
private boolean resoudre(Sudoku s, boolean afficherEtape, EtatResolution etat) {
|
||||
|
||||
Reference in New Issue
Block a user