|
@ -30,7 +30,7 @@ char* bauer_umwandel_abfrage(char** Brett, int startX, int startY, int endX, int |
|
|
printf("q für Dame, r für Turm, b für Läufer oder n für Springer"); |
|
|
printf("q für Dame, r für Turm, b für Läufer oder n für Springer"); |
|
|
Figur = getUserInput(); |
|
|
Figur = getUserInput(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if((player == PLAYER_WHITE && (Figur == 'Q' || Figur == 'R' || Figur == 'B' || Figur == 'N')) || |
|
|
if((player == PLAYER_WHITE && (Figur == 'Q' || Figur == 'R' || Figur == 'B' || Figur == 'N')) || |
|
|
(player == PLAYER_BLACK && (Figur == 'q' || Figur == 'r' || Figur == 'b' || Figur == 'n'))){ |
|
|
(player == PLAYER_BLACK && (Figur == 'q' || Figur == 'r' || Figur == 'b' || Figur == 'n'))){ |
|
|
return Figur; |
|
|
return Figur; |
|
@ -43,7 +43,12 @@ char* bauer_umwandel_abfrage(char** Brett, int startX, int startY, int endX, int |
|
|
|
|
|
|
|
|
void bauer_umwandeln(char** Brett, int startX, int startY, int endX, int endY, Player player){ |
|
|
void bauer_umwandeln(char** Brett, int startX, int startY, int endX, int endY, Player player){ |
|
|
|
|
|
|
|
|
Brett[endY][endX] = bauer_umwandel_abfrage(Brett,startX,startY,endX,endY,player); |
|
|
|
|
|
Brett[startY][startX] = ' '; |
|
|
|
|
|
|
|
|
char* Figur = bauer_umwandel_abfrage(Brett,startX,startY,endX,endY,player); |
|
|
|
|
|
if(Figur != 'W'){ |
|
|
|
|
|
Brett[endY][endX] = Figur; |
|
|
|
|
|
Brett[startY][startX] = ' '; |
|
|
|
|
|
}else{ |
|
|
|
|
|
printf("Zug ungültig"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|