mirror of
https://github.com/tiyn/yeschess.git
synced 2025-04-01 14:47:44 +02:00
lichess: turned down difficulty and removed unnecessary echoes
This commit is contained in:
parent
5bee0f84d2
commit
9ea20b6c1f
@ -11,7 +11,7 @@ var session = berserk.TokenSession(secret.api_token)
|
||||
var client = berserk.Client(session=session)
|
||||
|
||||
let engineID = "tiyn-ychess"
|
||||
let engineDifficulty = 5
|
||||
let engineDifficulty = 3
|
||||
let toAccept = ["tiynger"]
|
||||
|
||||
|
||||
@ -27,22 +27,16 @@ proc playGame(id: string) {.async.} =
|
||||
echo("gameFull received")
|
||||
movesString = event["state"]["moves"]
|
||||
if $event["white"]["id"] == engineID:
|
||||
echo("white assigned")
|
||||
color = Color.White
|
||||
if $event["black"]["id"] == engineID:
|
||||
echo("black assigned")
|
||||
color = Color.Black
|
||||
else:
|
||||
echo("gameState received")
|
||||
movesString = event["moves"]
|
||||
echo("movesString",movesString)
|
||||
if $movesString != "":
|
||||
echo("movestring not empty")
|
||||
var moves = movesString.split(" ")
|
||||
game.checkedMove(notationToMove($moves[-1], game.toMove))
|
||||
game.echoBoard(game.toMove)
|
||||
echo("toMove", game.toMove)
|
||||
echo("color", color)
|
||||
if game.toMove == color:
|
||||
echo("engine has to make a move")
|
||||
var bestMove = moveToNotation(game.bestMove(engineDifficulty))
|
||||
|
Loading…
x
Reference in New Issue
Block a user