if (w>9) {
int[][] row = new int[9][1];
for (int l=0; l<9; l++) row[l][0] = mx[i-9+l][j];
int sum = getSum(row);
int rnd = _random.nextInt(sum);
Position p = getPos(row, rnd);
//System.out.println("RandomH: "+p);
return new Position(i-9+p.x, j);
}
}
}
for (int i=0; i<mx.length; i++) {
for (int j=0, w=0; j<mx[0].length; j++) {
if (mx[i][j]!=0) w++;
else w = 0;
if (w>9) {
//return new Position(i, j-_random.nextInt(9));
int[][] row = new int[9][1];
for (int l=0; l<9; l++) row[l][0] = mx[i][j-9+l];
int sum = getSum(row);
int rnd = _random.nextInt(sum);
Position p = getPos(row, rnd);
//System.out.println("RandomV: "+p);
return new Position(i, j-9+p.x);
}
}
}
return null;
}