lila/modules/ai/src/main/stockfish/Stockfish.scala

14 lines
354 B
Scala

package lila.ai
package stockfish
import model.play.BestMove
import chess.Game
object Stockfish {
def applyMove(game: Game, pgn: String, move: String) = for {
bestMove model.play.BestMove(move.some filter ("" !=)).parse toValid "Wrong bestmove " + move
result (game withPgnMoves pgn)(bestMove.orig, bestMove.dest)
} yield result
}