Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/engine/ai/categorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@ function detectJosekiMoves(engine: GobanEngine, score_loss_list: ScoreLossList):
continue;
}

// Always count the move in this zone before any exit checks
zoneState.moves_in_zone[zone] += 1;
zoneState.zone_loss[zone] += move_loss;

// Check if move is on the edge near an adjacent zone that's not in joseki
if (num_zones === 8) {
const nearbyAdjacent = getNearbyAdjacentZones(x, y, width, height, zone);
Expand All @@ -424,9 +428,6 @@ function detectJosekiMoves(engine: GobanEngine, score_loss_list: ScoreLossList):
}
}

zoneState.moves_in_zone[zone] += 1;
zoneState.zone_loss[zone] += move_loss;

// First move in a zone gets 2x threshold tolerance
const effectiveSingleMoveThreshold =
zoneState.moves_in_zone[zone] === 1
Expand Down
Loading