Skip to content
Snippets Groups Projects
Commit 8627c54d authored by Clément Desberg's avatar Clément Desberg
Browse files

commited on 20240509

parent ab5b2cea
Branches
No related merge requests found
No preview for this file type
......@@ -494,7 +494,7 @@ void board::promote(coordinates to_promote, piece_type new_type){
break;
}
//Put the newly added piece on the board
put(white_pieces[white_pieces.size()]);
put(white_pieces[white_pieces.size() - 1]);
}else{
switch (new_type)
{
......
......@@ -79,6 +79,7 @@ int main(){
chess_board.move(start,end);
correct_move = true;
if(chess_board.is_promotion_needed(end)){
chess_board.print();
// Promotion selection
std::cout << "Promotion. Choose a piece to substitue the pawn : B/N/R/Q" << std::endl;
std::string chose_promotion = "";
......
......@@ -22,5 +22,6 @@ f6g7
h6g4
g7h8
Q
#To remove, only during tests
/quit
wR,wN,wB,,wK,wB,wN,wR,wP,wP,wP,wP,,wP,wP,wP,,,,,,wQ,,,,,,,,,bN,,,,,,,,bP,,,,,,,,,,bP,bP,bP,bP,bP,,,bP,bR,bN,bB,bQ,bK,,,wQ, 1-0
......@@ -22,5 +22,7 @@ f6g7
h6g4
g7h8
R
#To remove, only during tests
/quit
wR,wN,wB,,wK,wB,wN,wR,wP,wP,wP,wP,,wP,wP,wP,,,,,,wQ,,,,,,,,,bN,,,,,,,,bP,,,,,,,,,,bP,bP,bP,bP,bP,,,bP,bR,bN,bB,bQ,bK,,,wR, 1-0
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment