Skip to content

Commit

Permalink
initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
f4r4z committed Mar 15, 2018
1 parent b65d661 commit ef5cbb7
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions SudokuExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
public class SudokuExample {
public static void main(String[] args) throws MalformedURLException {



//World's hardest sudoku
int[][] board = {
{8,0,0,0,0,0,0,0,0},
Expand All @@ -23,7 +21,6 @@ public static void main(String[] args) throws MalformedURLException {
};

Sudoku test = new Sudoku(board);

test.solve();
test.print();

Expand All @@ -37,13 +34,10 @@ public static void main(String[] args) throws MalformedURLException {

try {
Scanner scanner = new Scanner(file.openStream());


while(scanner.hasNextLine()) {

s += scanner.nextLine() + "\n";


}

} catch (IOException e) {
Expand All @@ -62,24 +56,21 @@ public static void main(String[] args) throws MalformedURLException {
if(lines[i].contains("Grid")) {
for(int r = 0; r < sudoku96.length; r++) {
for(int c = 0; c < sudoku96[r].length; c++) {

sudoku96[r][c] = Character.getNumericValue(lines[i+ r + 1].charAt(c));


}
}

//Sudoku class
Sudoku sudokuSolver = new Sudoku(sudoku96);
sudokuSolver.solve();
sudoku96 = sudokuSolver.getBoard();

//adds the 3 top left digits
String digits = sudoku96[0][0] + "" + sudoku96[0][1] + "" + sudoku96[0][2];
sum += Integer.parseInt(digits);

}



}

System.out.println();
Expand Down

0 comments on commit ef5cbb7

Please sign in to comment.