public boolean findWay(int[][] map,int i,int j) {
if(map[6][5] == 2) {
return true;
} else {
if(map[i][j] == 0) {
map[i][j] = 2;
if(findWay(map,i + 1,j)) {
return true;
} else if(findWay(map,i,j + 1)) {
return true;
} else if(findWay(map,i - 1,j)) {
return true;
} else if (findWay(map,i,j - 1)) {
return true;
} else {
map[i][j] = 3;
return false;
}
}
else {
return false;
要看调用的地方,调用的地方,判断这个方法的返回真假来做业务处理。