Skip to content

Commit

Permalink
Little refactorization and fixed free line evaluation
Browse files Browse the repository at this point in the history
szymonpoltorak committed Oct 23, 2022

Verified

This commit was signed with the committer’s verified signature.
Brooooooklyn LongYinan
1 parent dd6342c commit cf0ce9e
Showing 12 changed files with 454 additions and 358 deletions.
14 changes: 5 additions & 9 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
*.python text diff=python
*.python text diff=python
*.py text diff=python

*.css text diff=css
*.html text diff=html
*.tld text
*.xml text
*.css text diff=css
*.html text diff=html
*.tld text
*.xml text
*.scss text diff=scss

*.jpg binary
*.jpeg binary
*.png binary

*.md text diff=markdown
*.mdx text diff=markdown
*.tex text diff=tex
*.pdf diff=astextplain
*.PDF diff=astextplain
*.txt text

.gitignore export-ignore
.gitattributes export-ignore
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.idea/
__pycache__/
venv/
src/resources/ui/test.ui
src/resources/ui/test.ui
.fleet/
.pytest_cache
16 changes: 10 additions & 6 deletions src/main/game_window/engine/Evaluator.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,11 @@

from numba import jit

from game_window.engine.StaticEvaluator import StaticEvaluator
from game_window.engine.static_eval.KingPressure import KingPressure
from game_window.engine.static_eval.LightPiecesEval import LightPiecesEval
from game_window.engine.static_eval.PawnEval import PawnEval
from game_window.engine.static_eval.RookEval import RookEval
from game_window.engine.static_eval.StaticEvaluator import StaticEvaluator

if TYPE_CHECKING:
from game_window.Board import Board
@@ -15,11 +19,11 @@ def debug_evaluate_position(board: 'Board', favor_color: int) -> int:

material_eval = StaticEvaluator.evaluate_pieces_on_board(board, favor_color)
center_possession_eval = StaticEvaluator.evaluate_center_possession(board, favor_color)
light_dev_eval = StaticEvaluator.evaluate_light_pieces_walked(board, favor_color)
king_pressure = StaticEvaluator.evaluate_king_pressure(board, favor_color)
bishops = StaticEvaluator.evaluate_bishops(board, favor_color)
free_lines = StaticEvaluator.evaluate_free_lines_for_rooks(board, favor_color)
chains = StaticEvaluator.evaluate_pawn_chains(board, favor_color)
light_dev_eval = LightPiecesEval.evaluate_light_pieces_walked(board, favor_color)
king_pressure = KingPressure.evaluate_king_pressure(board, favor_color)
bishops = LightPiecesEval.evaluate_bishops(board, favor_color)
free_lines = RookEval.evaluate_free_lines_for_rooks(board, favor_color)
chains = PawnEval.evaluate_pawn_chains(board, favor_color)

print(f"\tmaterialEval = {material_eval}\n\tcenterPossessionEval = {center_possession_eval}\n\tlightDevEval = {light_dev_eval}\n\tkingPressure = {king_pressure}")
print(f"\tbishops = {bishops}\n\tfree lines = {free_lines}\n\tpawn chains = {chains}")
256 changes: 0 additions & 256 deletions src/main/game_window/engine/StaticEvaluator.py

This file was deleted.

60 changes: 60 additions & 0 deletions src/main/game_window/engine/static_eval/KingPressure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import math
from typing import TYPE_CHECKING

from numba import jit
from numpy import ndarray

from game_window.CheckUtil import CheckUtil
from game_window.ColorManager import ColorManager
from game_window.enums.BoardEnum import BoardEnum

if TYPE_CHECKING:
from game_window.Board import Board


class KingPressure:
@staticmethod
def evaluate_king_pressure(board: 'Board', favor_color: int) -> int:
"""
Method used to evaluate pressure on king.
:param board: Board instance
:param favor_color: int value of color in favor of which we evaluate position
:return: int evaluation
"""
enemy_color: int = ColorManager.get_opposite_piece_color(favor_color)
pressure_on_enemy_king = KingPressure.evaluate_king_pressure_only_for_color(board, favor_color)
pressure_on_my_king = KingPressure.evaluate_king_pressure_only_for_color(board, enemy_color)
evaluation: int = int(pressure_on_enemy_king - pressure_on_my_king)

return evaluation

@staticmethod
@jit(forceobj=True)
def evaluate_king_pressure_only_for_color(board: 'Board', favor_color: int) -> int:
"""
Method used to evaluate distance of pieces to the enemy king
:param favor_color: int value of color
:param board: Board instance
:return: int value of evaluation
"""
enemy_color: int = ColorManager.get_opposite_piece_color(favor_color)
board_array: ndarray[int] = board.get_board_array()

enemy_king_pos = CheckUtil.find_friendly_king_squares(board_array, enemy_color)
enemy_king_x = math.floor(enemy_king_pos / 8)
enemy_king_y = enemy_king_pos - 8 * enemy_king_x
score_accumulator = 0

for pos in range(BoardEnum.BOARD_SIZE.value):
if ColorManager.get_piece_color(board_array[pos]) != favor_color:
continue
my_piece_x = math.floor(pos / 8)
my_piece_y = pos - 8 * my_piece_x

x_diff = enemy_king_x - my_piece_x
y_diff = enemy_king_y - my_piece_y

distance = math.sqrt(x_diff * x_diff + y_diff * y_diff)
score = 8 * math.sqrt(2) - distance
score_accumulator += score
return score_accumulator
91 changes: 91 additions & 0 deletions src/main/game_window/engine/static_eval/LightPiecesEval.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
from typing import TYPE_CHECKING

from numba import jit
from numpy import array
from numpy import int8
from numpy import ndarray

from game_window.ColorManager import ColorManager
from game_window.engine.static_eval.StaticEvalUtil import StaticEvalUtil
from game_window.enums.EvalEnum import EvalEnum
from game_window.enums.PiecesEnum import PiecesEnum

if TYPE_CHECKING:
from game_window.Board import Board


class LightPiecesEval:
@staticmethod
@jit(forceobj=True)
def evaluate_bishops(board: 'Board', favor_color: int) -> int:
"""
Method used to evaluate if player has a pair of bishops.
:param favor_color: int value of color
:param board: Board instance
:return: int value of evaluation
"""
evaluation: int = 0
board_array: ndarray[int] = board.get_board_array()
engine_color: int = board.get_engine_color()
player_color: int = board.get_player_color()
engine_bishops: int = 0
player_bishops: int = 0

for square, piece in enumerate(board_array):
if piece == PiecesEnum.NONE.value:
continue

if piece == engine_color | PiecesEnum.BISHOP.value:
engine_bishops += 1
elif piece == player_color | PiecesEnum.BISHOP.value:
player_bishops += 1
if engine_bishops >= 2:
evaluation += EvalEnum.BISHOP_PAIR.value
if player_bishops >= 2:
evaluation -= EvalEnum.BISHOP_PAIR.value
return StaticEvalUtil.return_proper_evaluation_signed_value(board, evaluation, favor_color)

@staticmethod
@jit(forceobj=True)
def evaluate_light_pieces_walked(board: 'Board', favor_color: int) -> int:
"""
Method used to evaluate if light pieces are walked from their starting position
:param favor_color:
:param board: Board instance
:return: int value of evaluation
"""
pieces = array([PiecesEnum.KNIGHT.value, PiecesEnum.BISHOP.value, PiecesEnum.BISHOP.value, PiecesEnum.KNIGHT.value])
board_array: ndarray[int] = board.get_board_array()
favorable_accumulator: int = 0
enemy_color: int = ColorManager.get_opposite_piece_color(favor_color)
unfavorable_accumulator: int = 0
favor_light_walked: int = 0
un_favor_light_walked: int = 0

light_pieces_positions: dict = {
board.get_engine_color(): array([1, 2, 5, 6], dtype=int8),
board.get_player_color(): array([57, 58, 61, 62], dtype=int8),
}

for i in range(0, 4):
position = light_pieces_positions[favor_color][i]
enemy_position = light_pieces_positions[enemy_color][i]

if board_array[position] == favor_color | pieces[i]:
favorable_accumulator -= EvalEnum.WALKED.value
else:
favor_light_walked += 1
favorable_accumulator += EvalEnum.WALKED.value

if board_array[enemy_position] == enemy_color | pieces[i]:
unfavorable_accumulator -= EvalEnum.WALKED.value
else:
un_favor_light_walked += 1
unfavorable_accumulator += EvalEnum.WALKED.value
if favor_light_walked != 4 and StaticEvalUtil.is_queen_on_start_position(favor_color, board):
favor_light_walked -= 2 * EvalEnum.WALKED.value
if un_favor_light_walked != 4 and StaticEvalUtil.is_queen_on_start_position(enemy_color, board):
favor_light_walked -= 2 * EvalEnum.WALKED.value

evaluation: int = favorable_accumulator - unfavorable_accumulator
return StaticEvalUtil.return_proper_evaluation_signed_value(board, evaluation, favor_color)
Original file line number Diff line number Diff line change
@@ -3,90 +3,30 @@
from numpy import ndarray

from game_window.ColorManager import ColorManager
from game_window.enums.EvalEnum import EvalEnum
from game_window.engine.static_eval.StaticEvalUtil import StaticEvalUtil
from game_window.enums.PiecesEnum import PiecesEnum

if TYPE_CHECKING:
from game_window.Board import Board


class EvalUtil:
class PawnEval:
@staticmethod
def return_proper_evaluation_signed_value(board: 'Board', evaluation: int, favor_color: int) -> int:
def evaluate_pawn_chains(board: 'Board', favor_color: int) -> int:
"""
Method used to return a proper mark of evaluation based on favor_color to move
:param favor_color:
Method used to evaluate pawn chains on board
:param board: Board instance
:param evaluation: int value of evaluation
:return: int value with proper sign
"""
return evaluation if favor_color == board.get_engine_color() else -evaluation

@staticmethod
def is_queen_on_start_position(color: int, board: 'Board') -> bool:
"""
Method used to check if queen is on starting position
:param color: int vale of color
:param board: Board instance
:return: bool
"""
start_positions = {
board.get_engine_color(): 3,
board.get_player_color(): 59
}

for square, piece in enumerate(board.get_board_array()):
if piece == color | PiecesEnum.QUEEN.value and start_positions[color] == square:
return True
return False

@staticmethod
def get_piece_point_value(piece_value: int) -> int:
"""
Method used to get proper eval value of a piece
:param piece_value: int value of piece
:return: int value of piece eval
"""
pieces_dict = {
PiecesEnum.KNIGHT.value: EvalEnum.KNIGHT.value,
PiecesEnum.BISHOP.value: EvalEnum.BISHOP.value,
PiecesEnum.ROOK.value: EvalEnum.ROOK.value,
PiecesEnum.QUEEN.value: EvalEnum.QUEEN.value,
PiecesEnum.PAWN.value: EvalEnum.PAWN.value,
PiecesEnum.KING.value: EvalEnum.KING.value
}
return pieces_dict[piece_value]

@staticmethod
def is_it_free_line(board: 'Board', square: int, step: int, direction: int) -> bool:
# TODO CHECK IF DISTANCES ARE BEING COUNTED RIGHT
"""
Checks if given line is free of any piece
:param board: Board instance
:param square: rook position in array
:param step: direction step
:param direction: direction id in distances array
:return: bool
:param favor_color: int value of color
:return: int
"""
second_direction: int = 4 if direction == 3 else 6
board_array: ndarray[int] = board.get_board_array()
distances: ndarray = board.get_distances()
enemy_color: int = ColorManager.get_opposite_piece_color(favor_color)

first_distance: int = distances[square][direction]
first_border: int = first_distance * step + step
favor_eval: int = PawnEval.get_pawn_chains_eval(board, favor_color)
enemy_eval: int = PawnEval.get_pawn_chains_eval(board, enemy_color)

second_distance: int = distances[square][second_direction]
second_step: int = -step
second_border: int = second_distance * second_step + second_step
evaluation: int = favor_eval - enemy_eval

for index in range(square, first_border, step):
if board_array[index] != PiecesEnum.NONE.value:
return False

for index in range(square, second_border, second_step):
if board_array[index] != PiecesEnum.NONE.value:
return False
return True
return StaticEvalUtil.return_proper_evaluation_signed_value(board, evaluation, favor_color)

@staticmethod
def is_friendly_pawn(board: 'Board', square: int, piece_color: int) -> bool:
@@ -115,7 +55,7 @@ def get_left_leaning_chain(board: 'Board', index: int, color: int, step_left: in
:param step_left: int value of step of a left pawn move
:return: int
"""
if not EvalUtil.is_friendly_pawn(board, index, color):
if not PawnEval.is_friendly_pawn(board, index, color):
raise ValueError("IT SHOULD NOT HAPPEN!")

chain_left_side = []
@@ -126,9 +66,10 @@ def get_left_leaning_chain(board: 'Board', index: int, color: int, step_left: in

while can_i_go_left(working_index):
working_index += step_left

if working_index < 0 or working_index > 63:
break
if not EvalUtil.is_friendly_pawn(board, index, color):
if not PawnEval.is_friendly_pawn(board, index, color):
break
chain_left_side.append(working_index)

@@ -137,13 +78,14 @@ def get_left_leaning_chain(board: 'Board', index: int, color: int, step_left: in

while can_i_go_right(working_index):
working_index += -step_left

if working_index < 0 or working_index > 63:
break
if not EvalUtil.is_friendly_pawn(board, index, color):
if not PawnEval.is_friendly_pawn(board, index, color):
break
chain_right_side.append(working_index)

left_leaning_chain = chain_right_side + [index] + chain_left_side

return len(left_leaning_chain)

@staticmethod
@@ -156,7 +98,7 @@ def get_right_leaning_chain(board: 'Board', index: int, color: int, step_right:
:param step_right: int value of step of a right pawn move
:return: int
"""
if not EvalUtil.is_friendly_pawn(board, index, color):
if not PawnEval.is_friendly_pawn(board, index, color):
raise ValueError("IT SHOULD NOT HAPPEN!")
chain_right_side = []
working_index = index
@@ -167,23 +109,23 @@ def get_right_leaning_chain(board: 'Board', index: int, color: int, step_right:

while can_i_go_right(working_index):
working_index += step_right

if working_index < 0 or working_index > 63:
break
if not EvalUtil.is_friendly_pawn(board, index, color):
if not PawnEval.is_friendly_pawn(board, index, color):
break
chain_right_side.append(working_index)

chain_left_side = []
working_index = index

while can_i_go_left(working_index):
working_index += -step_right

if working_index < 0 or working_index > 63:
break
if not EvalUtil.is_friendly_pawn(board, index, color):
if not PawnEval.is_friendly_pawn(board, index, color):
break
chain_left_side.append(working_index)

right_leaning_chain = chain_right_side + [index] + chain_left_side

return len(right_leaning_chain)
@@ -196,15 +138,15 @@ def get_pawn_chains_eval(board: 'Board', color: int) -> int:
:param color: int value of color
:return: int
"""
step_left = -9 if color == board.get_player_color() else +7
step_right = -7 if color == board.get_player_color() else +9
step_left = -9 if color == board.get_player_color() else 7
step_right = -7 if color == board.get_player_color() else 9

chain_eval = 0

for index in range(0, 64):
if not EvalUtil.is_friendly_pawn(board, index, color):
if not PawnEval.is_friendly_pawn(board, index, color):
continue

chain_eval += EvalUtil.get_left_leaning_chain(board, index, color, step_left)
chain_eval += EvalUtil.get_right_leaning_chain(board, index, color, step_right)
chain_eval += PawnEval.get_left_leaning_chain(board, index, color, step_left)
chain_eval += PawnEval.get_right_leaning_chain(board, index, color, step_right)
return chain_eval
112 changes: 112 additions & 0 deletions src/main/game_window/engine/static_eval/RookEval.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
from typing import TYPE_CHECKING

from numba import jit
from numpy import ndarray

from game_window.ColorManager import ColorManager
from game_window.engine.static_eval.StaticEvalUtil import StaticEvalUtil
from game_window.enums.EvalEnum import EvalEnum
from game_window.enums.PiecesEnum import PiecesEnum

if TYPE_CHECKING:
from game_window.Board import Board


class RookEval:
@staticmethod
@jit(forceobj=True)
def evaluate_free_lines_for_rooks(board: 'Board', favor_color: int) -> int:
"""
Methods used to evaluate free lines for rooks
:param favor_color: int value of color
:param board: Board instance
:return: int value of evaluation
"""
board_array: ndarray[int] = board.get_board_array()
evaluation: int = 0

for square, piece in enumerate(board_array):
piece_color: int = ColorManager.get_piece_color(piece)
piece_value: int = piece - piece_color

if piece_value == PiecesEnum.ROOK.value:
free_line_eval = RookEval.get_free_line_eval(board, square)
evaluation += StaticEvalUtil.return_proper_evaluation_signed_value(board, free_line_eval, piece_color)
return StaticEvalUtil.return_proper_evaluation_signed_value(board, evaluation, favor_color)

@staticmethod
def get_horizontal_eval(start_square: int, board: 'Board') -> int:
"""
Method used to evaluate horizontal lines of rooks
:param start_square: starting square of a rook
:param board: Board instance
:return: int
"""
left_step: int = -1
right_step: int = 1
board_array: ndarray[int] = board.get_board_array()
distances: ndarray[int] = board.get_distances()
distance_to_left: int = distances[start_square][3]
distance_to_right: int = distances[start_square][4]
left_border: int = start_square + left_step * distance_to_left - 1
right_border: int = start_square + right_step * distance_to_right + 1

for index in range(start_square - 1, left_border, left_step):
if distance_to_left == 0:
break

if board_array[index] != PiecesEnum.NONE.value:
return 0

for index in range(start_square + 1, right_border, right_step):
if distance_to_right == 0:
break

if board_array[index] != PiecesEnum.NONE.value:
return 0
return EvalEnum.FREE_LINE.value

@staticmethod
def get_vertical_eval(start_square: int, board: 'Board') -> int:
"""
Method used to evaluate vertical lines of rooks
:param start_square: starting square of a rook
:param board: Board instance
:return: int
"""
top_step: int = -8
bottom_step: int = 8
board_array: ndarray[int] = board.get_board_array()
distances: ndarray[int] = board.get_distances()
distance_to_top: int = distances[start_square][1]
distance_to_bottom: int = distances[start_square][6]
top_border: int = start_square + top_step * distance_to_top - 1
bottom_border: int = start_square + bottom_step * distance_to_bottom + 1

for index in range(start_square - 8, top_border, top_step):
if distance_to_top == 0:
break

if board_array[index] != PiecesEnum.NONE.value:
return 0

for index in range(start_square + 8, bottom_border, bottom_step):
if distance_to_bottom == 0:
break

if board_array[index] != PiecesEnum.NONE.value:
return 0
return EvalEnum.FREE_LINE.value

@staticmethod
def get_free_line_eval(board: 'Board', start_square: int) -> int:
"""
Method used to get free lines evals
:param board: Board instance
:param start_square: int starting square of a rook
:return: int
"""
horizontal_eval: int = RookEval.get_horizontal_eval(start_square, board)
vertical_eval: int = RookEval.get_vertical_eval(start_square, board)

return horizontal_eval + vertical_eval
55 changes: 55 additions & 0 deletions src/main/game_window/engine/static_eval/StaticEvalUtil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
from typing import TYPE_CHECKING

from game_window.enums.EvalEnum import EvalEnum
from game_window.enums.PiecesEnum import PiecesEnum

if TYPE_CHECKING:
from game_window.Board import Board


class StaticEvalUtil:
@staticmethod
def return_proper_evaluation_signed_value(board: 'Board', evaluation: int, favor_color: int) -> int:
"""
Method used to return a proper mark of evaluation based on favor_color to move
:param favor_color:
:param board: Board instance
:param evaluation: int value of evaluation
:return: int value with proper sign
"""
return evaluation if favor_color == board.get_engine_color() else -evaluation

@staticmethod
def is_queen_on_start_position(color: int, board: 'Board') -> bool:
"""
Method used to check if queen is on starting position
:param color: int vale of color
:param board: Board instance
:return: bool
"""
start_positions = {
board.get_engine_color(): 3,
board.get_player_color(): 59
}

for square, piece in enumerate(board.get_board_array()):
if piece == color | PiecesEnum.QUEEN.value and start_positions[color] == square:
return True
return False

@staticmethod
def get_piece_point_value(piece_value: int) -> int:
"""
Method used to get proper eval value of a piece
:param piece_value: int value of piece
:return: int value of piece eval
"""
pieces_dict = {
PiecesEnum.KNIGHT.value: EvalEnum.KNIGHT.value,
PiecesEnum.BISHOP.value: EvalEnum.BISHOP.value,
PiecesEnum.ROOK.value: EvalEnum.ROOK.value,
PiecesEnum.QUEEN.value: EvalEnum.QUEEN.value,
PiecesEnum.PAWN.value: EvalEnum.PAWN.value,
PiecesEnum.KING.value: EvalEnum.KING.value
}
return pieces_dict[piece_value]
90 changes: 90 additions & 0 deletions src/main/game_window/engine/static_eval/StaticEvaluator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
from typing import TYPE_CHECKING

from numba import jit
from numpy import ndarray

from game_window.ColorManager import ColorManager
from game_window.engine.static_eval.KingPressure import KingPressure
from game_window.engine.static_eval.LightPiecesEval import LightPiecesEval
from game_window.engine.static_eval.PawnEval import PawnEval
from game_window.engine.static_eval.RookEval import RookEval
from game_window.engine.static_eval.StaticEvalUtil import StaticEvalUtil
from game_window.enums.BoardEnum import BoardEnum
from game_window.enums.EvalEnum import EvalEnum
from game_window.enums.PiecesEnum import PiecesEnum

if TYPE_CHECKING:
from game_window.Board import Board


class StaticEvaluator:
@staticmethod
@jit(forceobj=True)
def evaluate_static_position(board: 'Board', favor_color: int) -> int:
"""
Method used to return an evaluation of starting position
:param board: Board instance
:param favor_color: int value of color in favor of which we evaluate position
:return: int evaluation
"""
material_eval = StaticEvaluator.evaluate_pieces_on_board(board, favor_color)
center_possession_eval = StaticEvaluator.evaluate_center_possession(board, favor_color)
light_dev_eval = LightPiecesEval.evaluate_light_pieces_walked(board, favor_color)
king_pressure = KingPressure.evaluate_king_pressure(board, favor_color)
bishops = LightPiecesEval.evaluate_bishops(board, favor_color)
free_lines = RookEval.evaluate_free_lines_for_rooks(board, favor_color)
chains = PawnEval.evaluate_pawn_chains(board, favor_color)

static_eval = material_eval + center_possession_eval + light_dev_eval + king_pressure + free_lines + bishops
static_eval += chains

return static_eval

@staticmethod
@jit(forceobj=True)
def evaluate_pieces_on_board(board: 'Board', favor_color: int) -> int:
"""
Method used to sum value of pieces on board and return this sum as evaluation
:param favor_color:
:param board: Board instance
:return: int value of evaluation
"""
evaluation: int = 0
board_array: ndarray[int] = board.get_board_array()

for square in board_array:
if square == 0:
continue
pieces_color: int = ColorManager.get_piece_color(square)
piece_value: int = square - pieces_color
points: int = StaticEvalUtil.get_piece_point_value(piece_value)

evaluation += points if pieces_color == board.get_engine_color() else -points
return StaticEvalUtil.return_proper_evaluation_signed_value(board, evaluation, favor_color)

@staticmethod
@jit(forceobj=True)
def evaluate_center_possession(board: 'Board', favor_color: int) -> int:
"""
Method used to evaluate a center possession
:param favor_color: int value of color
:param board: Board instance
:return: int value of evaluation
"""
evaluation: int = 0
board_array: ndarray[int] = board.get_board_array()

for center_square in BoardEnum.CENTER_SQUARES.value:
piece: int = board_array[center_square]

if piece == PiecesEnum.NONE.value:
continue
piece_color: int = ColorManager.get_piece_color(piece)

if center_square in BoardEnum.CENTER_SIDE_SQUARES.value:
evaluation += StaticEvalUtil.return_proper_evaluation_signed_value(board, EvalEnum.SIDE_CENTER.value,
piece_color)
if center_square in BoardEnum.CENTER_MAIN_SQUARES.value:
evaluation += StaticEvalUtil.return_proper_evaluation_signed_value(board, EvalEnum.MAIN_CENTER.value,
piece_color)
return StaticEvalUtil.return_proper_evaluation_signed_value(board, evaluation, favor_color)
Empty file.
2 changes: 1 addition & 1 deletion src/main/game_window/enums/MoveEnum.py
Original file line number Diff line number Diff line change
@@ -58,6 +58,6 @@ class MoveEnum(Enum):
MAX_NUM_OF_MOVES: int = 80

TOP_DIR: int = 1
TOP_STEP: int = -8
LEFT_DIR: int = 3
TOP_STEP: int = 8
LEFT_STEP: int = -1

0 comments on commit cf0ce9e

Please sign in to comment.