mirror of
https://github.com/tiyn/yeschess.git
synced 2026-02-22 10:34:47 +01:00
project structure
The project previously wasnt structured very well. Now the engine has its own module so its more visible what file belongs to what topic.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import algorithm
|
||||
|
||||
import ./chess.nim
|
||||
import chess
|
||||
|
||||
type
|
||||
MoveTree = object
|
||||
@@ -184,7 +184,7 @@ proc bestMove*(chess: Chess, depth: int): Move =
|
||||
var tmpChess = chess
|
||||
tmpChess.checkedMove(move)
|
||||
var tmpEval = -tmpChess.negaMax(depth, LoVal, HiVal)
|
||||
#echo("move:", moveToNotation(move, tmpChess.board), "; eval:", tmpEval)
|
||||
echo("move:", moveToNotation(move, tmpChess.board), "; eval:", tmpEval)
|
||||
if tmpEval > bestEval:
|
||||
bestEval = tmpEval
|
||||
bestMove = move
|
||||
@@ -1,9 +1,9 @@
|
||||
import nimpy
|
||||
import asyncnet, asyncdispatch
|
||||
|
||||
import ./secret.nim
|
||||
import ./chess.nim
|
||||
import ./engine.nim
|
||||
import chess
|
||||
import engine/secret
|
||||
import engine/engine
|
||||
|
||||
let berserk = pyImport("berserk")
|
||||
|
||||
@@ -11,7 +11,7 @@ var session = berserk.TokenSession(secret.api_token)
|
||||
var client = berserk.Client(session = session)
|
||||
|
||||
let engineID = "tiyn-ychess"
|
||||
let engineDifficulty = 3
|
||||
let engineDifficulty = 2
|
||||
let toAccept = ["tiynger"]
|
||||
|
||||
|
||||
1
src/engine/nim.cfg
Normal file
1
src/engine/nim.cfg
Normal file
@@ -0,0 +1 @@
|
||||
--outdir:"../../bin/src"
|
||||
@@ -1,7 +1,7 @@
|
||||
import parseutils
|
||||
|
||||
import ./chess.nim
|
||||
import ./engine.nim
|
||||
import chess
|
||||
import engine/engine
|
||||
|
||||
proc runGameHotseat*(): void =
|
||||
## Initializes and runs a game of chess as hotseat.
|
||||
|
||||
2
src/nim.cfg
Normal file
2
src/nim.cfg
Normal file
@@ -0,0 +1,2 @@
|
||||
--outdir:"../bin/src"
|
||||
--path:"."
|
||||
Reference in New Issue
Block a user