1
0
mirror of https://github.com/tiyn/yeschess.git synced 2025-04-01 14:47:44 +02: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:
TiynGER 2021-05-15 02:10:29 +02:00
parent c6ecdd4c83
commit 73f32e8598
7 changed files with 15 additions and 9 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
*.db
bin
docs
pgn
secret.nim

View File

@ -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

View File

@ -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
View File

@ -0,0 +1 @@
--outdir:"../../bin/src"

View File

@ -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
View File

@ -0,0 +1,2 @@
--outdir:"../bin/src"
--path:"."

View File

@ -1,7 +1,7 @@
import einheit
include chess
include engine
include engine/engine
testSuite ChessTest of TestSuite: