|
|
@ -6,6 +6,28 @@ |
|
|
|
#include "Moving.h" |
|
|
|
#include "Koenig.h" |
|
|
|
|
|
|
|
bool GreiftBauerAn(char** Brett, int x, int y, Player player) { |
|
|
|
// Checke für weißen Bauer |
|
|
|
if (player == PLAYER_BLACK) { |
|
|
|
if (y > 0 && x > 0 && Brett[y - 1][x - 1] == 'P') { // Linke Diagonale |
|
|
|
return true; |
|
|
|
} |
|
|
|
if (y > 0 && x < 7 && Brett[y - 1][x + 1] == 'P') { // Rechte Diagonale |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
// Checke für schwarzen Bauer |
|
|
|
if (player == PLAYER_WHITE) { |
|
|
|
if (y < 7 && x > 0 && Brett[y + 1][x - 1] == 'p') { // Linke Diagonale |
|
|
|
return true; |
|
|
|
} |
|
|
|
if (y < 7 && x < 7 && Brett[y + 1][x + 1] == 'p') { // Rechte Diagonale |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
bool GreiftSpringerAn(char** Brett, int x, int y, Player player) { |
|
|
|
int Springerzüge[8][2] = { |
|
|
|
{2, 1}, {1, 2}, {-1, 2}, {-2, 1}, |
|
|
@ -31,6 +53,9 @@ bool istFeldUnsicher(char** Brett, int x, int y, Player player) { |
|
|
|
if (GreiftSpringerAn(Brett, x, y, player)) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
if (GreiftBauerAn(Brett, x, y, player)) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|