From bc979fee2feb11e29f68b30cc0d8bb42c50259e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Sun, 10 Jan 2021 20:35:45 +0200 Subject: [PATCH] Allow promoting to any piece --- takhta.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/takhta.html b/takhta.html index 2e41f80..81f9fab 100644 --- a/takhta.html +++ b/takhta.html @@ -348,13 +348,9 @@ case 'B': case 'N': case 'R': - promotion = move.slice(index, index + 1); - break; case 'K': - return {error: 'Cannot promote a piece to king'}; - break; case 'P': - return {error: 'Cannot promote a piece to pawn'}; + promotion = move.slice(index, index + 1); break; default: return {error: 'Unrecognized piece: ' + move.slice(index, index + 1)};