fixing the axes of the saveState

This commit is contained in:
l.dupuis-burtin 2024-05-30 16:23:21 +02:00
parent 520abea99c
commit 7ae1795911
2 changed files with 1 additions and 3 deletions

View File

@ -360,7 +360,7 @@ public class Simulator extends Thread {
for(int x=0;x<getWidth();x++) { for(int x=0;x<getWidth();x++) {
String sumElementToLine=""; String sumElementToLine="";
for(int y=0;y<getHeight();y++) { for(int y=0;y<getHeight();y++) {
sumElementToLine+=(Integer.toString(getCell(x, y))); sumElementToLine+=(Integer.toString(getCell(y, x)));
if(y<getHeight()-1) { if(y<getHeight()-1) {
sumElementToLine+=";"; sumElementToLine+=";";
} }

View File

@ -327,9 +327,7 @@ public class MyInterface extends JFrame {
String fileName=SelectFile(); String fileName=SelectFile();
if (fileName.length()>0) { if (fileName.length()>0) {
ArrayList<String> content = mySimu.getSaveState(); ArrayList<String> content = mySimu.getSaveState();
String[] strArr = Arrays.copyOf(content.toArray(), content.toArray().length, String[].class); String[] strArr = Arrays.copyOf(content.toArray(), content.toArray().length, String[].class);
writeFile(fileName, strArr); writeFile(fileName, strArr);
} }
} }