count each player's moves separately, not as pairs

This commit is contained in:
Jesse D. McDonald 2020-03-13 02:25:27 -05:00
parent 31b9bc70b3
commit 041a8a3242
1 changed files with 1 additions and 1 deletions

View File

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