Skip to content

Commit

Permalink
Make way for other engines in engine package
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshochadel committed Mar 13, 2021
1 parent 8cbf810 commit abb41fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions engine/engine.go → engine/minimax.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package engine

import (
"fmt"
"math"
"math/rand"
"strings"
Expand Down Expand Up @@ -35,6 +36,7 @@ func minimax(pos *chess.Position, depth int, maxPlayer bool) *positionScore {
value: evaluatePosition(pos),
}
}
pos.Hash()

bestScore := &positionScore{}
var comparator func(float64, float64) float64
Expand All @@ -48,6 +50,7 @@ func minimax(pos *chess.Position, depth int, maxPlayer bool) *positionScore {
}

for _, m := range pos.ValidMoves() {
fmt.Printf("Evaluating move %v\n", m)
candidate := &positionScore{
move: m,
value: minimax(pos.Update(m), depth-1, !maxPlayer).value,
Expand Down
File renamed without changes.

0 comments on commit abb41fe

Please sign in to comment.