gui: save sudoku
All checks were successful
Linux arm64 / Build (push) Successful in 42s

This commit is contained in:
2025-01-29 15:08:30 +01:00
parent 00866256a7
commit a616ab63e4
3 changed files with 22 additions and 11 deletions

View File

@@ -106,9 +106,9 @@ public class SudokuSerializer {
/**
* Save a serialized MultiDoku in a JSON file.
* @param doku MultiDoku, MultiDoku to save.
* @return int, number of the save.
* @return String, the path of the save.
*/
public static int saveMultiDoku(final MultiDoku doku) {
public static String saveMultiDoku(final MultiDoku doku) {
JSONObject jsonRoot = serializeSudoku(doku);
@@ -123,9 +123,9 @@ public class SudokuSerializer {
try (FileWriter file = new FileWriter(f)) {
file.write(jsonRoot.toString(3));
} catch (IOException e) {
e.fillInStackTrace();
e.printStackTrace();
}
return i;
return f.getAbsolutePath();
}
/**