|
@ -40,26 +40,26 @@ char* bauer_umwandel_abfrage(char** Brett, int startX, int startY, int endX, int |
|
|
if(player == PLAYER_WHITE){ |
|
|
if(player == PLAYER_WHITE){ |
|
|
printf("Q for Queen, R for Rook, B for Bishop, or N for Knight"); |
|
|
printf("Q for Queen, R for Rook, B for Bishop, or N for Knight"); |
|
|
//Figur = getUserInput(); |
|
|
//Figur = getUserInput(); |
|
|
Figur = 'Q'; |
|
|
|
|
|
|
|
|
Figur = "Q"; |
|
|
}else{ |
|
|
}else{ |
|
|
printf("q for Queen, r for Rook, b for Bishop, or n for Knight"); |
|
|
printf("q for Queen, r for Rook, b for Bishop, or n for Knight"); |
|
|
//Figur = getUserInput(); |
|
|
//Figur = getUserInput(); |
|
|
Figur = 'q'; |
|
|
|
|
|
|
|
|
Figur = "q"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ((player == PLAYER_WHITE && (Figur == 'Q' || Figur == 'R' || Figur == 'B' || Figur == 'N')) || |
|
|
|
|
|
(player == PLAYER_BLACK && (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'))) { |
|
|
return Figur; |
|
|
return Figur; |
|
|
} else { |
|
|
} else { |
|
|
return 'W'; // Undefiniertes Zeichen als Fehlerwert |
|
|
|
|
|
|
|
|
return (char *)'W'; // Undefiniertes Zeichen als Fehlerwert |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
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) { |
|
|
char Figur = bauer_umwandel_abfrage(Brett, startX, startY, endX, endY, player); |
|
|
|
|
|
|
|
|
char* Figur = bauer_umwandel_abfrage(Brett, startX, startY, endX, endY, player); |
|
|
|
|
|
|
|
|
Brett[endY][endX] = Figur; |
|
|
|
|
|
|
|
|
Brett[endY][endX] = *Figur; |
|
|
Brett[startY][startX] = ' '; |
|
|
Brett[startY][startX] = ' '; |
|
|
|
|
|
|
|
|
} |
|
|
} |