Improve AI error reporting
This commit is contained in:
parent
528d04b732
commit
71966f6972
|
@ -14,7 +14,7 @@ trait Dependencies {
|
|||
val specs2 = "org.specs2" %% "specs2" % "1.8.2"
|
||||
val casbah = "com.mongodb.casbah" %% "casbah" % "2.1.5-1"
|
||||
val salat = "com.novus" %% "salat-core" % "0.0.8-SNAPSHOT"
|
||||
val scalalib = "com.github.ornicar" %% "scalalib" % "1.23"
|
||||
val scalalib = "com.github.ornicar" %% "scalalib" % "1.24"
|
||||
val hasher = "com.roundeights" % "hasher" % "0.3" from "http://cloud.github.com/downloads/Nycto/Hasher/hasher_2.9.1-0.3.jar"
|
||||
val config = "com.typesafe.config" % "config" % "0.3.0"
|
||||
val json = "com.codahale" %% "jerkson" % "0.5.0"
|
||||
|
|
|
@ -39,7 +39,7 @@ final class AppXhr(
|
|||
_ ← finisher.moveFinish(g3, color)
|
||||
} yield ()
|
||||
else if (g3.player.isAi && g3.playable) for {
|
||||
aiResult ← ai(g3) map (_.toOption err "AI failure")
|
||||
aiResult ← ai(g3) map (_.err)
|
||||
(newChessGame, move) = aiResult
|
||||
g4 = g3.update(newChessGame, move)
|
||||
_ ← save(g1, g4)
|
||||
|
|
|
@ -16,7 +16,7 @@ final class Starter(
|
|||
_ ← if (game.variant == Standard) io() else gameRepo saveInitialFen game
|
||||
_ ← addEntry(game, entryData)
|
||||
g2 ← if (game.player.isHuman) io(game) else for {
|
||||
aiResult ← ai(game) map (_.toOption err "AI failure")
|
||||
aiResult ← ai(game) map (_.err)
|
||||
(newChessGame, move) = aiResult
|
||||
} yield game.update(newChessGame, move)
|
||||
} yield g2
|
||||
|
|
|
@ -27,7 +27,7 @@ final class CraftyAi(
|
|||
|
||||
runCrafty(forsyth, dbGame.aiLevel | 1) map { newFen ⇒
|
||||
for {
|
||||
newSituation ← Forsyth << newFen toValid "Cannot parse engine FEN"
|
||||
newSituation ← Forsyth << newFen toValid "Cannot parse engine FEN: " + newFen
|
||||
reverseEngineer = new ReverseEngineering(oldGame, newSituation.board)
|
||||
poss ← reverseEngineer.move toValid "Cannot reverse engineer engine move"
|
||||
(orig, dest) = poss
|
||||
|
|
Loading…
Reference in a new issue