Arcade.Replay
Functions
Play from s0: policy chooses the next action, or None when it has nothing to play (the game is over), and apply plays it. Stops when the policy says None, at the first refusal, or once most actions have been accepted. Returns the state reached, the accepted actions oldest first (so replay(cx, apply, s0, them) reaches the same state), and the refusal, if there was one.
Apply each action in order from s0, stopping at the first one apply refuses. Returns the state reached, how many actions were accepted (a prefix of actions), and the refusal, if there was one. Actions after a refusal are not tried: each was chosen against a state that no longer follows.
Play turns from s0 until the game is over or count reaches most. A turn may play several actions, and may tolerate refusals, so the state counts what it has played itself: count reads that, and turn plays one turn, or gives None when the game is over. The count is checked before each turn, then the turn.