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'];