blob: da7a0a52acf118b89d6c7b052e7e50d9ecd4d2e2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
extern crate zombot;
extern crate time;
use time::{PreciseTime, Duration};
use zombot::*;
use zombot::engine::constants::*;
const STATE_PATH: &str = "tests/state0.json";
use std::process;
fn main() {
bitwise();
}
fn bitwise() {
println!("Running bitwise engine");
let start_time = PreciseTime::now();
let state = match input::json::read_bitwise_state_from_file(STATE_PATH) {
Ok(ok) => ok,
Err(error) => {
println!("Error while parsing JSON file: {}", error);
process::exit(1);
}
};
let max_time = Duration::milliseconds(MAX_TIME_MILLIS);
strategy::monte_carlo::choose_move(&state, start_time, max_time);
}
|