5 private int[][] preBoard;
7 public Parser(String filename)
9 file = new File(filename);
10 preBoard = new int[9][9];
15 FileInputStream in = new FileInputStream(file.getPath());
18 for(int row = 0; row < 9; row++)
20 //grabs the row we're on
21 String temp = in.readLine();
24 System.out.println("Malformed file (not enough lines)");
28 //builds new scanner for the line
29 StringTokenizer scan = new StringTokenizer(temp);
30 if(scan.countTokens() < 8)
32 System.out.println("Malformed file (not enough columns");
36 for(int column = 0; column < 9; column++)
38 int num = Integer.parseInt(scan.nextToken());
41 //we may remove this later so that we can have everything instead of just this....
42 if(num > 9 || num < 0)
44 System.out.println("File is malformed");
46 // throw new FatalError("File is malformed");
50 preBoard[row][column] = num;
56 System.out.println("Parsing complete.");