Skip to content

Negative priorAttempts inflates score above first-try #6

Description

@royalpinto007

Problem

scoreCrack(ch, -5) returns 150, beating the first-try score of 100; NaN attempts yield NaN scores. Negative attempts should be impossible.

Where

lib/scoring.ts (efficiency = Math.max(0.4, 1 - priorAttempts * 0.1), no floor on attempts).

Acceptance

Add a failing test first asserting scoreCrack(ch, -1) clamps to the first-try value and scoreCrack(ch, NaN) never returns NaN. Then fix.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions