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.
master
TiynGER 4 years ago
parent c6ecdd4c83
commit 73f32e8598

3
.gitignore vendored

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

@ -1,6 +1,6 @@
import algorithm import algorithm
import ./chess.nim import chess
type type
MoveTree = object MoveTree = object
@ -184,7 +184,7 @@ proc bestMove*(chess: Chess, depth: int): Move =
var tmpChess = chess var tmpChess = chess
tmpChess.checkedMove(move) tmpChess.checkedMove(move)
var tmpEval = -tmpChess.negaMax(depth, LoVal, HiVal) 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: if tmpEval > bestEval:
bestEval = tmpEval bestEval = tmpEval
bestMove = move bestMove = move

@ -1,9 +1,9 @@
import nimpy import nimpy
import asyncnet, asyncdispatch import asyncnet, asyncdispatch
import ./secret.nim import chess
import ./chess.nim import engine/secret
import ./engine.nim import engine/engine
let berserk = pyImport("berserk") let berserk = pyImport("berserk")
@ -11,7 +11,7 @@ var session = berserk.TokenSession(secret.api_token)
var client = berserk.Client(session = session) var client = berserk.Client(session = session)
let engineID = "tiyn-ychess" let engineID = "tiyn-ychess"
let engineDifficulty = 3 let engineDifficulty = 2
let toAccept = ["tiynger"] let toAccept = ["tiynger"]

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

@ -1,7 +1,7 @@
import parseutils import parseutils
import ./chess.nim import chess
import ./engine.nim import engine/engine
proc runGameHotseat*(): void = proc runGameHotseat*(): void =
## Initializes and runs a game of chess as hotseat. ## Initializes and runs a game of chess as hotseat.

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

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

Loading…
Cancel
Save