示例#1
0
 // TODO: put your test cases here
 @Test
 public void testCase1() {
   Sudoku sudoku =
       new Sudoku(
           2,
           new int[][] {
             {0, 0, 0, 1},
             {2, 3, 0, 4},
             {0, 0, 0, 3},
             {4, 1, 0, 2}
           });
   assertEquals("...1\n23.4\n...3\n41.2\n", sudoku.toString());
   System.out.println(new Sudoku(3));
 }
示例#2
0
 /** Funkcia zabezpeci vykonanie prikazu, ktory je reprezentovany danou triedou */
 @Override
 public void execute() {
   InputGrid inputGrid = sudoku.getInputGrid();
   TextFieldLayer textFieldLayer = inputGrid.getTextFieldLayer();
   TextField[][] textFields = textFieldLayer.getTextFields();
   for (TextField[] row : textFields) {
     for (TextField text : row) {
       text.setText("");
     }
   }
   this.infoBox.addInfo("Grid cleared");
   this.infoBox.changeGivens("0");
 }
示例#3
0
 @Test
 public void testCase2() throws IOException, ParseException {
   Sudoku sudoku = Sudoku.fromFile(2, "samples\\sudoku_4x4.txt");
   assertEquals(".234\n341.\n214.\n.321\n", sudoku.toString());
 }