blob: 9a62aede4bdb933c77233e52400e26ace100efbf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
use std::path::Path;
use time::{Duration, PreciseTime};
use steam_powered_wyrm::game;
use steam_powered_wyrm::json;
use steam_powered_wyrm::strategy::choose_move;
fn main() {
let max_time = Duration::milliseconds(19950);
let start_time = PreciseTime::now();
match json::read_state_from_json_file(&Path::new(&format!("./tests/example-state.json"))) {
Ok(json_state) => {
let new_board = game::GameBoard::new(json_state);
let _ = choose_move(&new_board, start_time, max_time);
}
Err(e) => {
eprintln!("WARN: State file could not be parsed: {}", e);
}
};
}
|