Skip to content

Reference

tilttek/puzzle-builder
TypeRole
ScenarioThe puzzles and the finale of a scenario, its graph checked; read from plain values or JSON
PuzzleA puzzle: identifier, title, check of answers, hints, unlock
UnlockWhen a puzzle opens: puzzles required, how many of them, solves of the scenario, or by the host
HintA tier of hints: its text and penalty in seconds
PuzzleEngineGuesses, hints, puzzles opened or skipped by the host, statuses and the view
ProgressWhere a team stands: solves, puzzles opened, hints, guesses; written and read back as plain values
PuzzleStatusLocked, Open or Solved
GuessOutcomeCorrect, Partial, Wrong or Throttled
GuessResultWhat a guess or a skip gave, and the progress after it
HintResultThe hint revealed, its tier, the tiers left, and the progress after it
Answer\AnswerKeyAccepted and partial answers, normalized, compared in constant time
Answer\AnswerNormalizerHow answers and guesses are normalized: case, accents, punctuation, spaces
Answer\VerdictWhat a check says of a guess: correct, partial with its message, or wrong
Record\SolvedA puzzle solved, at a time, perhaps skipped
Record\HintTakenA tier of hints revealed, at a time, asked or pushed
View\ScenarioViewWhat the players see of their game
View\PuzzleViewWhat the players see of one puzzle
Limiter\AllowanceWhether a guess is checked now, and when it will be
Limiter\RateLimiterGuessLimiterGuesses counted by a limiter of symfony/rate-limiter
Limiter\InMemoryGuessLimiterGuesses counted in a fixed window, in memory
Contract\AnswerCheckHow the guesses of a puzzle are checked
Contract\GuessLimiterHow many guesses a team makes on a puzzle in a period
Event\PuzzleSolvedA puzzle solved or skipped
Event\PartialAnswerGivenA partial answer
Event\WrongAnswerGivenA wrong answer
Event\GuessThrottledA guess past the limit
Event\HintRevealedA hint revealed
Event\PuzzleOpenedA puzzle opened by a solve or by the host
Event\ScenarioCompletedA scenario ended

Instant is internal: the one way the library writes a time, in UTC.

Exceptions

ExceptionThrown when
Exception\PuzzleBuilderExceptionThe interface of every exception of the library
Exception\InvalidScenarioA scenario, a puzzle, an answer key, a hint, an unlock or a limiter the library refuses
Exception\InvalidAnswerA guess not UTF-8, empty once normalized, or longer than 200 characters
Exception\InvalidProgressA stored progress that does not read back against its scenario
Exception\PuzzleRefusedA move the game does not allow: a puzzle unknown, locked, solved, open already or without a hint left; a team named by an email address

Nothing changes when an exception is thrown. Each message says what was expected, as The puzzle "vault" is still locked.