From 1f2a082e551b7ccd73c86c0b63eadcbf43b20483 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 14 Jun 2021 16:38:14 +0300 Subject: feat: announce captures --- src/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.c b/src/main.c index 40bdba4..eaded89 100644 --- a/src/main.c +++ b/src/main.c @@ -175,10 +175,15 @@ int apply_move(int move[2], int* board) { int origin = move[0]; int destination = move[1]; int piece = board[origin]; + int target_piece = board[destination]; board[destination] = piece; board[origin] = EMPTY; + if (target_piece != EMPTY) { + printf("Captured %s\n", pieces[target_piece]); + } + return board[destination]; } -- cgit v1.2.3