Skip to main content

play

Function play 

Source
pub fn play<R: Sides>(
    rules: &mut R,
    bots_by_side: &mut [(R::Side, &mut dyn Bot<R>)],
    limit: u32,
) -> Result<Report<R>, PlayError<R>>
where R::Command: Clone,
Expand description

Plays rules until the game ends or turn limit has passed, asking the bot of the side to move for each command. bots_by_side gives one bot per side; a side with no bot there is a mistake in the caller and panics.

A play stopped by the limit has no outcome, and its turns is the turn that was starting.