1
0
mirror of https://github.com/tiyn/yeschess.git synced 2025-10-20 14:51:21 +02:00

engine: first push for engine

I created an engine, that uses a basic version of the minimax algorithm
to evaluate a position.
It then evaluates all the possible next moves in a given position and picks
the one that has the best evaluation.
Basic test cases were also added.
This commit is contained in:
TiynGER
2021-04-27 00:49:39 +02:00
parent 0e27d0a6b5
commit 4ba3e06d93
3 changed files with 189 additions and 3 deletions

View File

@@ -24,8 +24,8 @@ type
castleRights: CastleRights
Move* = object
## `Move` stores all important information for a move.
start: int
dest: int
start*: int
dest*: int
color: Color
prom: int
PieceAmount = tuple
@@ -136,7 +136,7 @@ let
"e": 3,
"f": 2,
"g": 1,
"h": 0
"h": 0,
}.newTable ## \
# `FileChar` maps the files of the chessboard to numbers for better
# conversion.