Skip to main content

Module replay

Module replay 

Source
Expand description

replay: a record of a game re-run by the game’s own rules, with a state hash per step (shuyi_core::state_hash). One record is run twice, which finds luck or state that a run doesn’t own; two records are run side by side. The answer says the first step where the two runs’ hashes differ, and passes if there is none.

What a record is belongs to the game (for a turn game: its seed and its commands, ADR-0003 §2). turns re-runs one over any TurnRules.

A record stamped with what made it (ReplayRun::made) is checked against this build’s stamp (GameTools::made) before anything is compared: one made by another engine, another build of the game or other content is refused, since its runs may differ with no desync, unless the input says any_stamp.

Structs§

Difference
Where two runs part.
Record
A record handed to the game: its file’s name and its text.
ReplayInput
What replay re-runs.
ReplayOutput
What replay found.
ReplayRun
One run of a record.
ReplayStep
One step of a run: the state after a command.

Functions§

first_difference
The first step where a and b differ, if they do.
replay
replay: input’s records, under root, re-run by game.
text
What replay found, for people.
turns
Re-runs commands from initial by the rules, hashing the state before them and after each: the run of a turn game’s record file. A refused command changes nothing and says why.