-
Notifications
You must be signed in to change notification settings - Fork 0
/
writerr.java
35 lines (31 loc) · 1.08 KB
/
writerr.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import java.io.FileWriter;
import java.io.IOException;
public class writerr
{
static String fin = "";
static int[][] board = new int[9][9];
public static void ent_val(int[][] b){
board = b;
}
public static void write() {
try(FileWriter fileWriter =
new FileWriter("saved.txt", false) ){
for (int i = 0; i < board.length; i++) {
for (int j = 0; j < board[0].length; j++) {
if (j == 8) {
fin = fin + String.valueOf(board[i][j]);
//System.out.print(String.valueOf(template[i][j]));
}else{
fin = fin + String.valueOf(board[i][j]) + " ";
//System.out.print(String.valueOf(template[i][j]) + " ");
}
}
fileWriter.write(fin + "\r\n");
fin = "";
}
//fileWriter.write("data 1");
//fileWriter.write("data 2");
}catch(IOException e) {
}
}
}