Skip to content

feat: implement WCA-compliant inspection penalties (+2 and DNF) #66

Description

@vansh2604-star

Description

This PR updates the timer's inspection logic to comply with the official World Cube Association (WCA) regulations regarding the 15-second inspection period.

Currently, the timer strictly assigns a DNF (penalty: -1) if the user exceeds 15 seconds of inspection. According to WCA Regulations (Article A3), the penalties should be tiered:

  • 0 - 15 seconds: No penalty.
  • 15 - 17 seconds: +2 second penalty (penalty: 2).
  • > 17 seconds: DNF (penalty: -1).

Changes Made

  • Modified the updateInspection function in src/App.jsx to accurately track elapsed inspection time beyond 15 seconds.
  • Introduced logic to correctly apply a penalty: 2 if the timer is started between 15 and 17 seconds.
  • Kept the penalty: -1 (DNF) fallback only if the inspection time strictly exceeds 17 seconds.
  • (Optional: Add any UI tweaks you make here, like showing a red "+2" during the 15-17s window)

Why is this important?

For competitive speedcubers training at home, having an accurate representation of competition rules is critical. This change ensures that CubeIt provides a realistic simulation of a WCA competition environment.

Testing

  • Verified that starting the timer before 15 seconds results in penalty: 0.
  • Verified that holding the timer to start between 15 and 17 seconds results in penalty: 2 (and correctly adds 2 seconds to the final solve time in the Sidebar history).
  • Verified that holding the timer past 17 seconds automatically aborts the solve and logs a DNF.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions