From 041a8a324210021dd0491240cf7d6e59f7f26f4d Mon Sep 17 00:00:00 2001 From: Jesse McDonald Date: Fri, 13 Mar 2020 02:25:27 -0500 Subject: [PATCH] count each player's moves separately, not as pairs --- js/chess.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/chess.js b/js/chess.js index f980113..537de1c 100644 --- a/js/chess.js +++ b/js/chess.js @@ -82,7 +82,7 @@ function boardPut(board, where, side, piece){ function countMoves(board) { var n = 0; while (board && board['prior']) { - if (board['player'] === 'light' && board['prior']['player'] !== 'light') { + if (board['prior']['player'] !== board['player']) { ++n; } board = board['prior'];