Skip to main content

Module playtest

Module playtest 

Source
Expand description

playtest: the game’s named bots (its entrants) each play its stage K times from seeds seed, seed + 1, …, the game measures every try, and its checks say per bot whether it succeeded as often as wanted (shuyi_core::bots::playtest). The game gives the plan (GameTools::playtest_plan): its stages, its entrants and their groups, its checks and how one try is played. This plays the tries on every core (crate::pool), times them, and judges them once in seed order, so the report never depends on the thread count. The answer passes unless a rate fell under its floor.

Each entrant’s line carries the plan’s summary items (Summary), and kept keeps every run in a history and says what the last run of the same stage, entrants and options found.

Each try keeps its commands and its record for replay, if the game gives one (TryKept), and each entrant its outcomes counted and the spread of its turns and measures. A plan with no checks is a plain bot run: nothing is judged, and it passes when every try played.

Structs§

Played
How one entrant’s tries went, besides the report: its label, its speed, its summary and the last run’s headline.
PlaytestArgs
What playtest’s arguments ask for: the input, the file to write the JSON answer to, if any, and whether the text is brief.
PlaytestInput
What playtest plays. A number left out is the game’s default (GameTools::playtest_defaults).
PlaytestOutput
What playtest found on one stage.
Previous
The last run before this one, from the history.
Spread
How a number spread over an entrant’s tries.
TryKept
What the answer keeps of one try besides the report’s line: how many commands were applied, and its record.

Enums§

Summary
One number of an entrant’s tries, as playtest prints it after the entrant’s name. A try missing the measure counts it as 0. label defaults to the measure’s name ("most" for Most).

Constants§

DEFAULT_HISTORY
Where the history is kept when the input doesn’t say, from the project’s folder.
DEFAULT_TRIES
The tries when neither the input nor the game says: 100 from seed 0, each stopped at turn 200.
MAX_TRIES
The most tries of each entrant one playtest plays.

Functions§

brief
text without the table’s line per try (--brief).
kept
playtest, each stage’s run kept in the history under root (unless no_history) and compared with the last one kept there: each entrant’s was and the stage’s previous. A history that can’t be written fails the answer, naming the file.
options_text
The game’s start options, a line each, for a usage.
parse_args
Reads playtest’s arguments (not --json).
playtest
playtest: input’s tries of game’s plan, played on threads and judged; a report a stage, one unless every_stage. It keeps no history: kept does.
text
What playtest found, for people: for each stage, the plan’s title, the report’s table, then a line per entrant with its label, its summary, its speed and what it was in the last run, and that run’s date and commit. A stage with no checks, a plain bot run, then has each entrant’s outcomes counted and the spread of its turns and measures.
usage
playtest’s usage, with the game’s start options.