Skip to content

Commit

Permalink
Implemented score interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
hrushikeshrv committed Jan 29, 2023
1 parent 33336b8 commit 78c9ccf
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 63 deletions.
6 changes: 3 additions & 3 deletions chessengine/bitboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ def search_forward(self, depth: int = 4) -> tuple[int, tuple[int, int]]:
best_move = moves[0]

for move in moves:
self.move(start=move[0], end=move[1])
self.move(start=move[0], end=move[1], score=move[2])
value = self.alpha_beta_search(
depth=depth - 1, maximizing_player=not maximize
)
Expand Down Expand Up @@ -853,7 +853,7 @@ def alpha_beta_search(
value = -100000
moves = self.get_moves(self.side)
for move in moves:
self.move(start=move[0], end=move[1])
self.move(start=move[0], end=move[1], score=move[2])
final_score = self.alpha_beta_search(depth - 1, alpha, beta, False)
value = max(value, final_score)
self.undo_move()
Expand All @@ -865,7 +865,7 @@ def alpha_beta_search(
value = 100000
moves = self.get_moves(self.opponent_side)
for move in moves:
self.move(start=move[0], end=move[1])
self.move(start=move[0], end=move[1], score=move[2])
final_score = self.alpha_beta_search(depth - 1, alpha, beta, True)
value = min(value, final_score)
self.undo_move()
Expand Down
Loading

0 comments on commit 78c9ccf

Please sign in to comment.