mirror of
https://github.com/Noratrieb/minmax.git
synced 2026-01-17 00:35:05 +01:00
AAAAAAAAAAAAAAAAAAAAAAAAa
This commit is contained in:
parent
7f3a0e5ad2
commit
d3d7011c43
13 changed files with 280 additions and 88 deletions
|
|
@ -1,13 +1,17 @@
|
|||
use crate::{GamePlayer, Player, State};
|
||||
|
||||
use super::{board::Board, TicTacToe};
|
||||
use super::TicTacToe;
|
||||
|
||||
impl Board {
|
||||
impl TicTacToe {
|
||||
pub fn default_play<X: GamePlayer<TicTacToe>, O: GamePlayer<TicTacToe>>() -> Option<Player> {
|
||||
Self::empty().play(&mut X::default(), &mut O::default())
|
||||
}
|
||||
|
||||
pub fn play<A: GamePlayer<TicTacToe>, B: GamePlayer<TicTacToe>>(&mut self, x: &mut A, o: &mut B) -> Option<Player> {
|
||||
pub fn play<A: GamePlayer<TicTacToe>, B: GamePlayer<TicTacToe>>(
|
||||
&mut self,
|
||||
x: &mut A,
|
||||
o: &mut B,
|
||||
) -> Option<Player> {
|
||||
let mut current_player = Player::X;
|
||||
|
||||
for _ in 0..9 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue