increment i by 1 for summing values
This commit is contained in:
@@ -200,7 +200,7 @@ impl FutureMoves {
|
||||
.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 i128))
|
||||
.map(|(i, &child)| self.arena[child].value * ((i + 1) as i128))
|
||||
.sum::<i128>();
|
||||
|
||||
self.arena[idx].value =
|
||||
|
||||
Reference in New Issue
Block a user