This commit is contained in:
2025-01-28 15:48:44 -05:00
parent aab639c04d
commit 2189f00cb3
4 changed files with 39 additions and 19 deletions

View File

@@ -25,7 +25,7 @@ impl Game {
pub const fn new(player1: Box<dyn Agent>, player2: Box<dyn Agent>) -> Self {
Self {
players: [player1, player2],
board: Board::new(),
board: Board::new().starting_pos(),
}
}
@@ -45,15 +45,17 @@ impl Game {
pub fn game_loop(&mut self) {
let mut i = 0;
loop {
self.step(i);
// alternate which player plays
i += 1;
i %= self.players.len();
println!("{}", self);
std::thread::sleep(Duration::from_millis(100));
// return;
self.step(i);
std::thread::sleep(Duration::from_millis(200));
}
}
}