game
This commit is contained in:
parent
afef9f1b19
commit
1803176a24
12
src/agent.rs
12
src/agent.rs
@ -13,7 +13,7 @@ pub struct ManualAgent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Agent for ManualAgent {
|
impl Agent for ManualAgent {
|
||||||
fn next_move(&mut self, board: &Board) -> Option<(usize, usize)> {
|
fn next_move(&mut self, _: &Board) -> Option<(usize, usize)> {
|
||||||
todo!("user input not implemented")
|
todo!("user input not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ impl QueueAgent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Agent for QueueAgent {
|
impl Agent for QueueAgent {
|
||||||
fn next_move(&mut self, board: &Board) -> Option<(usize, usize)> {
|
fn next_move(&mut self, _: &Board) -> Option<(usize, usize)> {
|
||||||
self.moves.pop_front()
|
self.moves.pop_front()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ pub struct AutoAgent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Agent for AutoAgent {
|
impl Agent for AutoAgent {
|
||||||
fn next_move(&mut self, board: &Board) -> Option<(usize, usize)> {
|
fn next_move(&mut self, _: &Board) -> Option<(usize, usize)> {
|
||||||
todo!("next_move not implemented")
|
todo!("next_move not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,9 +71,3 @@ impl Agent for AutoAgent {
|
|||||||
self.color
|
self.color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AutoAgent {
|
|
||||||
pub const fn new(color: Piece) -> Self {
|
|
||||||
Self { color }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
10
src/main.rs
10
src/main.rs
@ -8,8 +8,14 @@ mod misc;
|
|||||||
mod repr;
|
mod repr;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let player1 = QueueAgent::new([(0, 0), (1, 0), (1, 2), (3, 2), (3, 0)], Piece::Black);
|
let player1 = QueueAgent::new(
|
||||||
let player2 = QueueAgent::new([(1, 1), (2, 2), (3, 3), (3, 1), (0, 2)], Piece::White);
|
[(0, 0), (1, 0), (1, 2), (3, 2), (3, 0), (3, 4), (0, 1)],
|
||||||
|
Piece::Black,
|
||||||
|
);
|
||||||
|
let player2 = QueueAgent::new(
|
||||||
|
[(1, 1), (2, 2), (3, 3), (3, 1), (0, 2), (4, 2), (3, 5)],
|
||||||
|
Piece::White,
|
||||||
|
);
|
||||||
let mut game = Game::new(Box::new(player1), Box::new(player2));
|
let mut game = Game::new(Box::new(player1), Box::new(player2));
|
||||||
game.game_loop();
|
game.game_loop();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user