Skip to content

Refactor input comparison logic for better readability#69

Merged
iamwatchdogs merged 1 commit intoGrow-with-Open-Source:mainfrom
Tithi234:patch-1
Feb 15, 2026
Merged

Refactor input comparison logic for better readability#69
iamwatchdogs merged 1 commit intoGrow-with-Open-Source:mainfrom
Tithi234:patch-1

Conversation

@Tithi234
Copy link
Contributor

@Tithi234 Tithi234 commented Feb 14, 2026

Summary

This PR extracts user input normalization (strip + lowercase)
into a small helper function to improve readability and
avoid repetition in the comparison logic.

Changes Made

  • Added normalize_input() helper function
  • Updated check_guess() to use the helper for comparison
  • No changes to game behavior or scoring logic

Why This Change?

Separating normalization logic improves maintainability and
makes comparison behavior more explicit and reusable.

Closes #69

Added input normalization function and improved input validation.
@github-actions
Copy link

👋 @Tithi234
Thank you for raising your pull request.
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.

Copy link
Contributor

@iamwatchdogs iamwatchdogs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and Approved by @iamwatchdogs.

@iamwatchdogs iamwatchdogs merged commit 7f99f80 into Grow-with-Open-Source:main Feb 15, 2026
4 checks passed
@github-actions
Copy link

Thank you for contributing @Tithi234. Make sure to check your contribution on GitHub Pages.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants