All pastes #912747 Raw Edit

Someone

public text v1 · immutable
·published 2008-02-21 16:26 UTC
rendered paste body
	public void solveNext(int[][] matrix,boolean[][]change, int row, int col, int j) throws Exception{
		col++;
		if(col == 9){
			row++;
			col = 0;
		}
		
		while(change[row][col]== false ){
			col++;
			if(col == 9){
				row++;
				col = 0;
			}
		}
		

		for(int k=j; k<=9;k++){
			if(!change[row][col]){
				return;
			}

			count++;
			if(count >900000){
				System.out.println(count);
			}

			matrix[row][col] = k;


			boolean chkk = chk(matrix,row,col);

			if(chkk &&(row == 8 && col == 8)){
				throw new Exception();	


			}else if(chkk) {
				solveNext(matrix,change,row,col, 1);
				int a = 0;

			}

		


		}
		matrix[row][col] = -1;
		return;
	}