summaryrefslogtreecommitdiff
path: root/ui/src
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2023-10-08 18:39:49 -0400
committerMicha White <botahamec@outlook.com>2023-10-08 18:39:49 -0400
commit5c72e1c67d9526e7b08945c1060a5c13c5839b0f (patch)
tree7909fcf27fbdc092ef8c6cad0a0326e524b126f2 /ui/src
parent25edb84f0f045df0db1383de3383e04b9ab431e3 (diff)
Better evaluation structure for force wins
Diffstat (limited to 'ui/src')
-rw-r--r--ui/src/main.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/ui/src/main.rs b/ui/src/main.rs
index 5981f54..43191e5 100644
--- a/ui/src/main.rs
+++ b/ui/src/main.rs
@@ -36,7 +36,7 @@ impl GameState {
bit_board: CheckersBitBoard::starting_position(),
selected_square: None,
possible_moves: HashSet::new(),
- evaluation: 0.5,
+ evaluation: 0.0,
transposition_table: TranspositionTable::new(5_000_000 / 18),
})
}
@@ -82,19 +82,19 @@ impl State for GameState {
// safety: this was determined to be in the list of possible moves
self.bit_board = unsafe { selected_move.apply_to(self.bit_board) };
- self.evaluation = engine::current_evaluation(
- 10,
+ let evaluation = engine::current_evaluation(
+ 7,
self.bit_board,
self.transposition_table.mut_ref(),
);
- println!("AI advantage: {}", self.evaluation);
+ println!("AI advantage: {}", evaluation);
// ai makes a move
while self.bit_board.turn() == PieceColor::Light
&& !PossibleMoves::moves(self.bit_board).is_empty()
{
let best_move = dbg!(engine::best_move(
- 16,
+ 14,
self.bit_board,
self.transposition_table.mut_ref()
));
@@ -103,12 +103,12 @@ impl State for GameState {
self.selected_square = None;
self.possible_moves.clear();
- self.evaluation = engine::current_evaluation(
- 10,
+ let evaluation = engine::current_evaluation(
+ 7,
self.bit_board,
self.transposition_table.mut_ref(),
);
- println!("Your advantage: {}", self.evaluation);
+ println!("Your advantage: {}", evaluation);
} else {
self.selected_square = Some(square);