Skip to content

R35-T039: Document user-choice complexity - #129

Open
suraj-3010 wants to merge 1 commit into
S-AI-Projects:mainfrom
suraj-3010:student/e26b07f1007/R35-T039
Open

suraj-3010 wants to merge 1 commit into
S-AI-Projects:mainfrom
suraj-3010:student/e26b07f1007/R35-T039

Conversation

@suraj-3010

@suraj-3010 suraj-3010 commented Nov 22, 2026 •

Copy link
Copy Markdown

Description

This PR documents and tests the work performed by get_user_choice(). The complexity note identifies string length as the input-size variable, accounts for lowercasing, the fixed five-item choices list, and retries.

Related Issue

Fixes: #39

Type of Change

  • Tests
  • Documentation

Changes Made

  • Added a simple complexity comment beside get_user_choice() without changing behavior or its public interface.
  • Added mocked-input tests for rock, scissors, and invalid input followed by paper.
  • Added a seeded operation-count model using five fresh inputs for each of three valid string lengths.
  • Added work/R35-T039/check.py and work/R35-T039/evidence.md.

Screenshots / Recordings

No UI changes.

Testing

Ran:

python3 work/R35-T039/check.py

Result: 3 tests passed. The operation-count model also completed 15 calls (five repetitions at each length 4, 5, and 8). Counts had medians 5, 10, and 11 respectively, each with a zero-width range. These are operation-model counts, not elapsed-time measurements.

Checklist

  • I have tested my changes locally.
  • I have added or updated tests, if needed.
  • I have updated documentation, if needed.
  • I have followed the project coding guidelines.
  • I have run the relevant tests and checks.

Additional Notes

For one entered string of length n, lowercasing is O(n); membership checks at most five fixed choices. A retry loop repeats that work for each entered string.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@suraj-3010 suraj-3010 changed the title test(rps): document user-choice complexity Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant