47 lines
1.4 KiB
Java
47 lines
1.4 KiB
Java
/*
|
|
* This Java source file was generated by the Gradle 'init' task.
|
|
*/
|
|
package sudoku;
|
|
|
|
import sudoku.io.SudokuPrinter;
|
|
import sudoku.structure.SudokuFactory;
|
|
|
|
import java.util.Arrays;
|
|
|
|
public class Main {
|
|
public String getGreeting() {
|
|
return "Hello World!";
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println(new Main().getGreeting());
|
|
|
|
int blockWidth = 2;
|
|
int blockHeight = 2;
|
|
var multidoku = SudokuFactory.createBasicEmptyRectangleDoku(blockWidth, blockHeight,
|
|
SudokuFactory.DEFAULT_CONSTRAINTS);
|
|
var sudoku = multidoku.getSubGrid(0);
|
|
if (!sudoku.setCellsSymbol(Arrays.asList(0, 1, 2, 3, 2, 3, 1, 1, 1, 0, 3, 2, 3, 2, 1, 1))) {
|
|
System.out.println("At least one of those values does not respect the constraints.");
|
|
}
|
|
|
|
// sudoku.setCellSymbol(8,3,0);
|
|
|
|
SudokuPrinter.printRectangleSudoku(multidoku.getSubGrid(0), blockWidth, blockHeight);
|
|
|
|
/*
|
|
* Solver solver = new Solver();
|
|
* ArrayList<IConstraint> constraints = new ArrayList<>();
|
|
* constraints.add(new LineConstraint());
|
|
* constraints.add(new ColumnConstraint());
|
|
* constraints.add(new BlockConstraint());
|
|
* try {
|
|
* solver.solve(multidoku, constraints);
|
|
* } catch (Exception e) {
|
|
* System.out.println(e);
|
|
* }
|
|
*/
|
|
|
|
}
|
|
}
|