diff options
author | eug-vs <eug-vs@keemail.me> | 2021-06-14 16:38:14 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2021-06-14 16:38:14 +0300 |
commit | 1f2a082e551b7ccd73c86c0b63eadcbf43b20483 (patch) | |
tree | 9bff26a7c67bb2d3d4d7be5df5a0bbfc62cbffd0 /src | |
parent | 50ffb304f0d4098ccbcc7e2fb286b2d3cc56e66c (diff) | |
download | c-chess-1f2a082e551b7ccd73c86c0b63eadcbf43b20483.tar.gz |
feat: announce captures
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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]; } |