diff --git a/src/future_moves.rs b/src/future_moves.rs index 0e67fe4..4e90c92 100644 --- a/src/future_moves.rs +++ b/src/future_moves.rs @@ -256,7 +256,10 @@ impl FutureMoves { let children_value = node .children .iter() - .map(|&child| self.arena[child].value) + .rev() // rev then reverse so we get an index starting from the back + .enumerate() + // since children are sorted by value, we should weight the first one more + .map(|(i, &child)| self.arena[child].value * (i as i64 + 1)) .sum::() .checked_div(node.children.len() as i64) .unwrap_or(0);