|
|
@ -9,8 +9,7 @@ bool istzugerlaubt_Turm(char** Brett, int startX, int startY, int endX, int endY |
|
|
|
|
|
|
|
int counter = 0; |
|
|
|
|
|
|
|
if(startX == endX){ |
|
|
|
if(startY<endY){ |
|
|
|
if(startX == endX && startY < endY){ |
|
|
|
counter = endY-startY; |
|
|
|
for(int i = 1; i<counter;i++){ |
|
|
|
if(Brett[startY+i][startX] != ' '){ |
|
|
@ -18,7 +17,7 @@ int counter = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
}else{ |
|
|
|
}else if(startX == endX && startY > endY){ |
|
|
|
counter = startY-endY; |
|
|
|
for(int i = 1; i<counter;i++){ |
|
|
|
if(Brett[startY-i][startX] != ' '){ |
|
|
@ -26,19 +25,16 @@ int counter = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}else if(startY == endY){ |
|
|
|
if(startX<endX){ |
|
|
|
}else if(startY == endY && startX<endX){ |
|
|
|
counter = endX-startX; |
|
|
|
for(int i = 1; i<counter;i++){ |
|
|
|
if(Brett[startY][startX+i] != ' '){ |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
}else{ |
|
|
|
}else if(startY == endY && startX>endX){ |
|
|
|
counter = startX-endX; |
|
|
|
for(int i = 1; i<counter;i++){ |
|
|
|
if(Brett[startY][startX-i] != ' '){ |
|
|
@ -46,13 +42,9 @@ int counter = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|