Skip to main content

GameSum

Struct GameSum 

Source
pub struct GameSum<'a, G, const MISERE: bool = false> {
    game: &'a mut G,
}

Fields§

§game: &'a mut G

Implementations§

Source§

impl<'a, 'g, G> GameSum<'a, ImpartialGraph<'g, G>>
where G: Graph + VertexMap<Option<usize>>,

Source

pub fn grundy(self) -> GameAnalysis<'a, ImpartialGraph<'g, G>, [G::Vertex], u64>

Source§

impl<'a, 'g, G, const MISERE: bool> GameSum<'a, ImpartialGraph<'g, G>, MISERE>
where G: Graph + VertexMap<Option<usize>>,

Source

pub fn outcome( self, ) -> GameAnalysis<'a, ImpartialGraph<'g, G>, [G::Vertex], GameOutcome, MISERE>

Normal play combines generalized Grundy values, including cyclic positions. Misere explores the sum graph, which can grow exponentially in the component count.

Source§

impl<'a, S, L, F, I> GameSum<'a, Impartial<S, F>>
where S: Clone + Eq + Hash, F: FnMut(&S) -> I, I: IntoIterator<Item = Neighbor<S, L>>,

Source

pub fn grundy(self) -> GameAnalysis<'a, Impartial<S, F>, [S], u64>

Source§

impl<'a, S, L, F, I, const MISERE: bool> GameSum<'a, Impartial<S, F>, MISERE>
where S: Clone + Eq + Hash, F: FnMut(&S) -> I, I: IntoIterator<Item = Neighbor<S, L>>,

Source

pub fn outcome( self, ) -> GameAnalysis<'a, Impartial<S, F>, [S], GameOutcome, MISERE>

Source§

impl<'a, S, L, FL, FR, IL, IR> GameSum<'a, Partisan<S, FL, FR>>
where S: Clone + Eq + Hash, FL: FnMut(&S) -> IL, FR: FnMut(&S) -> IR, IL: IntoIterator<Item = Neighbor<S, L>>, IR: IntoIterator<Item = Neighbor<S, L>>,

Source

pub fn value(self) -> GameAnalysis<'a, Partisan<S, FL, FR>, [S], GameValue>

Source§

impl<'a, S, L, FL, FR, IL, IR, const MISERE: bool> GameSum<'a, Partisan<S, FL, FR>, MISERE>
where S: Clone + Eq + Hash, FL: FnMut(&S) -> IL, FR: FnMut(&S) -> IR, IL: IntoIterator<Item = Neighbor<S, L>>, IR: IntoIterator<Item = Neighbor<S, L>>,

Source

pub fn outcome( self, ) -> GameAnalysis<'a, Partisan<S, FL, FR>, [S], PartisanOutcome, MISERE>

Explores reachable sum positions, including the player to move. Reuses cached sums of numbers, ups, nimbers and switches in normal play.

Source§

impl<'a, G> GameSum<'a, G>

Source

pub fn misere(self) -> GameSum<'a, G, true>

Auto Trait Implementations§

§

impl<'a, G, const MISERE: bool = false> !UnwindSafe for GameSum<'a, G, MISERE>

§

impl<'a, G, const MISERE: bool> Forget for GameSum<'a, G, MISERE>

§

impl<'a, G, const MISERE: bool> Freeze for GameSum<'a, G, MISERE>

§

impl<'a, G, const MISERE: bool> Move for GameSum<'a, G, MISERE>

§

impl<'a, G, const MISERE: bool> RefUnwindSafe for GameSum<'a, G, MISERE>

§

impl<'a, G, const MISERE: bool> Send for GameSum<'a, G, MISERE>
where &'a mut G: Send,

§

impl<'a, G, const MISERE: bool> Sync for GameSum<'a, G, MISERE>
where &'a mut G: Sync,

§

impl<'a, G, const MISERE: bool> Unpin for GameSum<'a, G, MISERE>

§

impl<'a, G, const MISERE: bool> UnsafeUnpin for GameSum<'a, G, MISERE>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToArrayVecScalar for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.