|
|
@ -3,8 +3,12 @@ package src; |
|
|
|
import org.json.simple.JSONArray; |
|
|
|
import org.json.simple.JSONObject; |
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
import java.io.FileNotFoundException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Scanner; |
|
|
|
|
|
|
|
public class Model { |
|
|
|
|
|
|
@ -84,7 +88,29 @@ public class Model { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void loadAllData() { |
|
|
|
public String loadAllData() { |
|
|
|
|
|
|
|
|
|
|
|
File file = new File("src/main/java/src/sudoku.save"); |
|
|
|
|
|
|
|
if (file.exists()) { |
|
|
|
try { |
|
|
|
file.createNewFile(); |
|
|
|
} catch (IOException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
} |
|
|
|
String line = ""; |
|
|
|
try { |
|
|
|
Scanner scanner = new Scanner(file); |
|
|
|
while (scanner.hasNextLine()) { |
|
|
|
line = line + scanner.nextLine(); |
|
|
|
|
|
|
|
} |
|
|
|
} catch (FileNotFoundException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
return line; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|