All pastes #611360 Raw Edit

Anonymous

public java v1 · immutable
·published 2007-07-09 21:53 UTC
rendered paste body
	int check(int[][] inSd,int index) {		if(index >= 81)			return 1;		int row = index / 9;		int col = index % 9;		int squ = (3*9*(row / 3)) + (3*(col / 3));		for(int i = 0; i < 9; i++) {			if((inSd[row][col] == inSd[i][col]) && row != i || (inSd[row][col] == inSd[row][i]) && col != i)				return 0;			int chkSq = ((9*(i%3)+squ+(i/3)));			int sqR = chkSq / 9;			int sqC = chkSq % 9;			if((inSd[row][col] == inSd[sqR][sqC]) && (row != sqR || col != sqC))				return 0;		}		return 1*check(inSd, ++index);	}