diff options
author | Jaume Delclòs Coll <cosa@cosarara.me> | 2024-05-08 13:08:47 +0000 |
---|---|---|
committer | Jaume Delclòs Coll <cosa@cosarara.me> | 2024-05-08 13:08:47 +0000 |
commit | 4e61d1e8c83b92a0e5f791cc9ca9e968447261b5 (patch) | |
tree | e37078ea911a5b9dde0650a6250afc1f9385a335 | |
parent | 700a054974068b7cc886e3d0a4701eddcbdc59cb (diff) |
promotion to queen
-rw-r--r-- | chess.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -6,7 +6,7 @@ #include <keyboard.h> // Missing features -// promotion +// underpromotion // display checkmate and stalemate // arrows to go back and forward in history // show moves better @@ -275,6 +275,12 @@ do_move(int board[8][8], Point src, Point dst, MoveType move_type) { } BRDPT(victim) = empty; } + if (move_type == Normal && BRDPT(dst) == bP && dst.y == RANK(1)) { + BRDPT(dst) = bQ; + } + if (move_type == Normal && BRDPT(dst) == wP && dst.y == RANK(8)) { + BRDPT(dst) = wQ; + } Point rook_src, rook_dst; switch (move_type) { case BlackLongCastle: |