diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 6f3fba5..d2ec145 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,10 +7,12 @@ use time::{Duration, PreciseTime}; use steam_powered_wyrm::command::{Action, Command}; use steam_powered_wyrm::game; use steam_powered_wyrm::json; -use steam_powered_wyrm::strategy::choose_move; +use steam_powered_wyrm::strategy::{choose_move, ScoreConfig}; fn main() { let max_time = Duration::milliseconds(900); + let config = ScoreConfig::default(); + let mut game_board = None; for line in stdin().lock().lines() { let start_time = PreciseTime::now(); @@ -24,13 +26,13 @@ fn main() { Ok(json_state) => match &mut game_board { None => { let new_board = game::GameBoard::new(json_state); - let command = choose_move(&new_board, start_time, max_time); + let command = choose_move(&new_board, &config, start_time, max_time); game_board = Some(new_board); command } Some(game_board) => { game_board.update(json_state); - choose_move(&game_board, start_time, max_time) + choose_move(&game_board, &config, start_time, max_time) } }, Err(e) => { |