Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (27 sloc) 961 Bytes
#![feature(conservative_impl_trait)]
extern crate rand;
extern crate rayon;
extern crate smallvec;
extern crate three;
mod backend;
mod frontend;
fn main() {
use std::io::Write;
use std::io::stdout;
let mut board = backend::board::Board::new_standard_setup();
let mut player = backend::player::Player::White;
// frontend::example_window();
loop {
// println!("{}", board.print_board().join("\n"));
frontend::display_board(&board);
print!("AI {:?}", player);
stdout().flush().unwrap();
let before_move = std::time::Instant::now();
let (ai_score, ai_move) = backend::ai_move(&board, player, 6).unwrap();
let ai_move_secs = before_move.elapsed().as_secs();
println!(" score {} move duration secs {}", ai_score, ai_move_secs);
let new_board = board.make_move(ai_move.from, ai_move.to);
board = new_board;
player = player.opposite();
}
}
You can’t perform that action at this time.