Skip to content

Add Math Facts Reaction Duel #18

Description

@ap0ught

Feature

Add a synchronized two-player Math Facts Reaction Duel for the paired ESP32-2432S028 CYDs.

Gameplay

  • Both players receive the same math fact at the same synchronized start time.
  • Each board displays multiple large answer buttons.
  • The first confirmed correct answer wins the fact.
  • An incorrect answer locks that player out briefly or awards the opponent the point, according to the selected ruleset.
  • A match consists of a configurable number of facts, with synchronized scores and a deterministic final winner.
  • The result is not final until the submitted answer and reaction event are validated against canonical game state.

Difficulty options

  • Addition.
  • Subtraction.
  • Multiplication.
  • Division with whole-number results.
  • Mixed operations.
  • Configurable operand ranges.
  • Optional negative-number and missing-operand modes.
  • Optional timed streak mode.

Fair timing

  • Precommit each round before revealing the fact.
  • Use a synchronized reveal deadline so network arrival order does not determine the winner.
  • Record reaction events against the shared round/reveal identity.
  • Compare validated reaction timing deterministically with an explicit tie window.
  • Reject answers submitted before reveal, after timeout, or for a stale fact.

Synchronization

  • Generate facts and answer choices deterministically from synchronized state.
  • Guarantee exactly one correct displayed answer and canonicalize distractors.
  • Use authenticated sender identity, active-game epochs, ACK/retry, replay rejection, and full-state reconciliation.
  • Define behavior for simultaneous correct answers, simultaneous wrong answers, disconnects, and restart recovery.

Navigation

  • Both boards provide an EXIT control during countdowns, facts, results, and match completion.
  • Either player may return both devices to the shared Home selector.
  • EXIT dominates answer events, retries after packet/ACK loss, and cannot be undone by stale packets.

Acceptance criteria

  • Facts and answer choices are mathematically valid and deterministic.
  • Both boards reveal each fact at the intended synchronized deadline.
  • Early, stale, duplicate, wrong, correct, tied, and timed-out answers are handled deterministically.
  • Difficulty and operation filters work as configured.
  • Scores and match completion remain synchronized.
  • EXIT works from either board in every phase.
  • Pure rules pass strict host compilation with -std=c++17 -Wall -Wextra -Werror.
  • Encrypted PlatformIO firmware builds successfully.
  • Both CYDs are flashed and physically verified for readability, touch accuracy, timing fairness, and bilateral EXIT.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions