public boolean Correct() { if (game.isAllBoardFilled()) { time = (int) (System.currentTimeMillis() - time) / 1000; return true; } return false; }
SimpleEntry<Integer, Integer> setRandomCell() { SimpleEntry<Integer, Integer> cellFilled = null; if (!game.isAllBoardFilled() && hints >= 1) { hints--; Random r = new Random(System.nanoTime()); int lineStart = r.nextInt(board.getSudokuSize()); int columnStart = r.nextInt(board.getSudokuSize()); boolean inserted = false; while (!inserted) { if (game.getCellNumber(lineStart, columnStart) == 0) { game.setCellNumber(lineStart, columnStart, board.getValueCell(lineStart, columnStart)); cellFilled = new SimpleEntry<Integer, Integer>(lineStart, columnStart); inserted = true; } else { if (columnStart == 8) { if (lineStart == 8) { lineStart = 0; columnStart = 0; } else { lineStart++; columnStart = 0; } } else columnStart++; } } } if (cellFilled == null) cellFilled = new SimpleEntry<Integer, Integer>(-1, -1); return cellFilled; }