Skip to content

Commit

Permalink
Revert "search: sort moves by score in root of search"
Browse files Browse the repository at this point in the history
This reverts commit b889c41.
  • Loading branch information
e0ff committed Nov 25, 2023
1 parent 661d92c commit 36cc95d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions internal/search/negamax.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,10 @@ func NewNegamaxSearcher(evaluator evaluation.Evaluator) NegamaxSearcher {
}

func (s NegamaxSearcher) Search(position chess.Position, depth int) ScoredMove {
moves := position.GenerateMoves(chess.LegalMoveGeneration)
bestMove := ScoredMove{}
bestScore := math.MinInt + 1

moves := position.GenerateMoves(chess.LegalMoveGeneration)
slices.SortFunc(moves, func(m1, m2 chess.Move) int {
return cmp.Compare(s.scoreMove(position, m1), s.scoreMove(position, m2))
})

for _, move := range moves {
position.MakeMove(move)

Expand Down

0 comments on commit 36cc95d

Please sign in to comment.