Compare commits
No commits in common. "e34b9ab57cdfcca4ab456e793da893275979dc7e" and "6de3e286ed50aee60a0b182fbcfd33963866f9cb" have entirely different histories.
e34b9ab57c
...
6de3e286ed
6 changed files with 34 additions and 56 deletions
14
app/src/main/java/sudoku/App.java
Normal file
14
app/src/main/java/sudoku/App.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* This Java source file was generated by the Gradle 'init' task.
|
||||
*/
|
||||
package sudoku;
|
||||
|
||||
public class App {
|
||||
public String getGreeting() {
|
||||
return "Hello World!";
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(new App().getGreeting());
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package sudoku;
|
||||
|
||||
public class Solver implements SudokuSolver {
|
||||
private int[][] board;
|
||||
|
||||
public Solver() {
|
||||
board = new int[9][9];
|
||||
}
|
||||
|
||||
public void setBoard(int[][] board) {
|
||||
this.board = board;
|
||||
}
|
||||
|
||||
public int[][] getBoard() {
|
||||
return board;
|
||||
}
|
||||
|
||||
public boolean solve() {
|
||||
}
|
||||
|
||||
public Boolean isSolved() {
|
||||
}
|
||||
|
||||
private boolean solve(int row, int col) {
|
||||
}
|
||||
|
||||
public boolean legal(int row, int col, int nbr) {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
package sudoku;
|
||||
|
||||
public class SolverMain {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello world!");
|
||||
}
|
||||
}
|
|
@ -1,6 +1,9 @@
|
|||
package sudoku;
|
||||
|
||||
public interface SudokuSolver {
|
||||
public interface SudokuSolver{
|
||||
|
||||
// Work in progress
|
||||
|
||||
/**
|
||||
* Set sudoku board, numbers 1-9 are fixed values, 0 is unsolved.
|
||||
*/
|
||||
|
@ -13,14 +16,12 @@ public interface SudokuSolver {
|
|||
|
||||
/**
|
||||
* Solve soduko
|
||||
*
|
||||
* @return true if solution could be found
|
||||
*/
|
||||
boolean solve();
|
||||
|
||||
/**
|
||||
* Check if digit is legal on the current board
|
||||
*
|
||||
* @param row
|
||||
* @param col
|
||||
* @param nbr
|
||||
|
|
14
app/src/test/java/sudoku/AppTest.java
Normal file
14
app/src/test/java/sudoku/AppTest.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* This Java source file was generated by the Gradle 'init' task.
|
||||
*/
|
||||
package sudoku;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class AppTest {
|
||||
@Test void appHasAGreeting() {
|
||||
App classUnderTest = new App();
|
||||
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package sudoku;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class SolverTest {
|
||||
@Test void boardTest() {
|
||||
Solver solver = new Solver();
|
||||
solver.solve();
|
||||
assertTrue(solver.isSolved());
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue