Commit 021374f5 authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix: add dieUsed property to bot move sequences

getAllMovesForDice was returning moves without dieUsed, causing
"(undefined)" in bot move log messages.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent c907013a
...@@ -206,8 +206,9 @@ var BackgammonConstants = (function() { ...@@ -206,8 +206,9 @@ var BackgammonConstants = (function() {
nextDice.splice(i, 1); nextDice.splice(i, 1);
for (var m = 0; m < moves.length; m++) { for (var m = 0; m < moves.length; m++) {
var result = applyMove(curBoard, curBar, curBorneOff, player, moves[m]); var moveWithDie = { from: moves[m].from, to: moves[m].to, hit: moves[m].hit, dieUsed: die };
var newSeq = sequence.concat([moves[m]]); var result = applyMove(curBoard, curBar, curBorneOff, player, moveWithDie);
var newSeq = sequence.concat([moveWithDie]);
dfs(result.board, result.bar, result.borneOff, nextDice, newSeq); dfs(result.board, result.bar, result.borneOff, nextDice, newSeq);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment