public static void main(String[] args){
		LevelGenerator lgGenerator = new LevelGenerator();
		char[] data;
		char[] temp = new char[81];
		data = Generator.getData();
		lgGenerator.handle(data);
		System.out.println(data);
		Solver solver = new Solver();
		
		BufferedWriter bw = null;
		File file = new File("D:/sudoku puzzle/new_level8.txt");
		try {
			bw = new BufferedWriter(new FileWriter(file));

			for (int i = 0; i < 500; i++) {
				data = Generator.getData();
				lgGenerator.handle(data);
				if(lgGenerator.isInvalid){
					i--;
					continue;
				}
				for(int j = 0; j < 81; j++){
					temp[j] = data[j];
				}
				
				solver.load(temp);
				solver.dfs(0);
				if(!solver.hasResult()){
					System.out.println(String.valueOf(temp) + " no result ");
					i--;
					continue;
				}
				System.out.println(data);
				bw.write(String.valueOf(data) + "\r\n");
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally {
			try {
				if(bw != null)
					bw.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}