game := chess.NewGame(chess.UseNotation(chess.UCINotation{}))
book := opening.NewBookECO()
moves := "e2e4 g8f6 e4e5 f6d5 f1c4"
ml := strings.Split(moves, " ")
for _, move := range ml {
if err := game.MoveStr(move); err != nil {
break
}
}
s := game.Moves()
p := book.Possible(s)
g2 := p[0]
m := g2.Game().Moves()
bestMove := m[5].String()
in this chunk of code bestmove should be "d5b6" instead of "b7b6".
The problem seems to be pgn multidecoder at line 170 of the pgn.go file as evidenced also by thangng48 issue
in this chunk of code bestmove should be "d5b6" instead of "b7b6". The problem seems to be pgn multidecoder at line 170 of the pgn.go file as evidenced also by thangng48 issue
https://github.com/notnil/chess/blob/e9ff96c9f2d309a51c820bc3068f2c4ec473664c/pgn.go#L170