Skip to content

password game done - #1722

Merged
UTSAVS26 merged 2 commits into
UTSAVS26:mainfrom
SHIV-360:password-odyssey-game
Aug 23, 2025
Merged

UTSAVS26 merged 2 commits into
UTSAVS26:mainfrom
SHIV-360:password-odyssey-game

Conversation

@SHIV-360

@SHIV-360 SHIV-360 commented Aug 22, 2025 •

Copy link
Copy Markdown
Contributor

Pull Request for PyVerse 💡

Requesting to submit a pull request to the PyVerse repository.


Issue Title

Password Odyssey Game

  • I have provided the issue title.

Info about the Related Issue

What's the goal of the project?
The aim of the project is to create an interactive password game where players attempt to generate a password that satisfies unique conditions. These conditions include length, character requirements, substrings, mathematical constraints, and forbidden patterns. The game provides feedback on failed conditions to guide players toward creating a valid password.

  • I have described the aim of the project.

Name

SHIVANG DWIVEDI

  • I have provided my name.

GitHub ID

SHIV-360

  • I have provided my GitHub ID.

Email ID

shivangd262@gmail.com

  • I have provided my email ID.

Identify Yourself

Contributing under SSoC25

  • I have mentioned my participant role.

Closes

*Closes: #1716

  • I have provided the issue number.

Describe the Add-ons or Changes You've Made

  • Added a new Python game game.py that challenges users to create a password satisfying 100 rules.

  • Implemented modular condition-checking functions (generate_conditions, check_password, password_game).

  • Added feedback mechanism showing progress and failed conditions.

  • Included a README.md explaining rules, features, installation, and example usage.

  • I have described my changes.


Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Tested the game interactively by running python game.py.

  • Verified that conditions trigger correct feedback.

  • Confirmed that an example password (baf1gSUNhiejklmopr5stu$w9c#w!d101b*w934ww0w2) passes all 100 conditions.

  • Checked edge cases such as too-short passwords, missing digits, or forbidden substrings.

  • I have described my testing process.


Checklist

  • My code follows the guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly wherever it was hard to understand.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added things that prove my fix is effective or that my feature works.
  • Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

  • New Features

    • Introduced “Password Odyssey,” an interactive Python password challenge with 100 strict rules, progress counter, first-failure feedback, quit command, and a success banner on completion.
    • Playable by running the game script (requires Python 3).
  • Documentation

    • Added README with game overview, full rules summary, setup/run instructions, how-to-play guidance, and a sample example password.

@coderabbitai

coderabbitai Bot commented Aug 22, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Adds a new Beginner_Projects/Password_Odyssey_Game with a README and a new CLI Python game implementing 100 predicate-based password conditions, an interactive loop showing only the first failed condition (or success), and a quit option.

Changes

Cohort / File(s) Summary
Documentation
Beginner_Projects/Password_Odyssey_Game/Readme.md
New README describing the game's purpose, rules summary, how to run the CLI game, example password, and high-level code structure (generate_conditions, check_password, password_game).
Game logic & CLI
Beginner_Projects/Password_Odyssey_Game/game.py
New Python module that defines generate_conditions() (100 predicate/message pairs), check_password(password, conditions) (returns is_valid, failed_messages, passed_count), and password_game() (interactive CLI loop, supports "quit", prints first failing condition or success banner). Runs under __main__.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant CLI as password_game()
  participant Engine as check_password()
  participant Rules as generate_conditions()

  User->>CLI: Run game.py
  CLI->>Rules: generate_conditions()
  Rules-->>CLI: conditions[1..100]

  loop Until success or quit
    CLI->>User: Prompt for password
    User-->>CLI: Input password or "quit"
    alt User types "quit"
      CLI-->>User: Exit message
      CLI-->>CLI: Terminate
    else Validate password
      CLI->>Engine: check_password(pw, conditions)
      Engine-->>CLI: is_valid, failed_msgs, passed_count
      alt All 100 passed
        CLI-->>User: Success banner (100/100)
        CLI-->>CLI: Terminate
      else First failure only
        CLI-->>User: Print first failing condition
      end
    end
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45–60 minutes

Assessment against linked issues

Objective Addressed Explanation
Add Password Odyssey project and CLI/interactive game mechanics (prompts, quit, first-failure feedback) [#1716] ✅
Implement 100 unique/creative conditions including SUN and 101 rules, palindrome and math constraints [#1716] ❓ Conditions count = 100 present; presence of SUN and 101 and many math/pattern constraints is visible, but specific requested conditions (e.g., prime ASCII sum, exact counts like "exactly 4 digits, 3 vowels, 2 specials") are not clearly matched to the stated examples.
Show only the first failed condition to the user [#1716] ✅
Provide a tkinter-based cosmic-themed UI with in-window dynamic feedback and an "Abandon Mission!" button [#1716] ❌ Implementation is a console/CLI; no tkinter UI, theming, or GUI button present.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Implemented CLI interactive loop instead of tkinter GUI (Beginner_Projects/Password_Odyssey_Game/game.py) The linked issue requests a tkinter cosmic-themed UI with in-window feedback and a GUI "Abandon Mission!" button; this change provides a console-based interface instead.

I hopped through code beneath the moonlit sky,
One hundred riddles tucked in a bytey sigh.
I nibble clues, reveal the first flubbed line—
I wiggle whiskers, try again this time.
When all align, I thump and cheer: "Password—yours and mine!" 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions

Copy link
Copy Markdown

✅ PR validation passed! Syncing labels and assignees from the linked issue...

@github-actions github-actions Bot added Contributor Denotes issues or PRs submitted by contributors to acknowledge their participation. level1 SSoC25 Status: Review Ongoing 🔄 PR is currently under review and awaiting feedback from reviewers. labels Aug 22, 2025
@github-actions

Copy link
Copy Markdown

👋 Thank you for opening this pull request! We're excited to review your contribution. Please give us a moment, and we'll get back to you shortly!

Feel free to join our community on Discord to discuss more!

@github-actions

Copy link
Copy Markdown

✅ PR validation passed! Syncing labels and assignees from the linked issue...

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🧹 Nitpick comments (7)
Beginner_Projects/Password_Odyssey_Game/game.py (4)

6-8: Compile regexes once to avoid repeated recompilation in no_run().

This is a low-cost micro-optimization and also clarifies intent.

Apply this diff:

-    def no_run(regex):
-        return lambda p: re.search(regex, p) is None
+    def no_run(pattern):
+        compiled = re.compile(pattern)
+        return lambda p: compiled.search(p) is None

155-157: Naming consistency: “Password Challenge” vs project name “Password Odyssey.”

Align the banner with the project name.

Apply this diff:

-    print("Welcome to the Password Challenge!")
-    print("Your password must satisfy 100 unique conditions.")
+    print("Welcome to Password Odyssey!")
+    print("Craft a password that satisfies 100 unique conditions.")

177-181: Show condition numbers in feedback for faster iteration.

If you adopt the indexed messages in check_password(), they’ll show up here automatically. Otherwise, prepend an index when printing.

Apply this diff if you don’t change check_password():

-            for i, failure in enumerate(failed_conditions):
-                print(f"NOTE: {failure}")
+            for i, failure in enumerate(failed_conditions):
+                print(f"NOTE: [{i+1}] {failure}")
                 break

33-70: Redundant special-character checks (optional).

Given:

  • exactly one each of #, !, *, $ (lines 60–63), and
  • “only these four are allowed” (line 64),

the “exactly 4 special characters” check (line 33) becomes redundant. Keeping it is harmless but duplicates intent. Consider removing or replacing it with a different rule to keep the “100 unique conditions” spirit.

Beginner_Projects/Password_Odyssey_Game/Readme.md (3)

18-25: Correct run instructions and path.

The script is under Beginner_Projects/Password_Odyssey_Game/. Running from repo root needs the relative path.

Apply this diff:

-   python game.py
+   python Beginner_Projects/Password_Odyssey_Game/game.py

32-37: Grammar and clarity: “satisfy” → “satisfies”, and add a safety note.

Also, remind users not to use real passwords.

Apply this diff:

-## Example Password
-An example password that satisfy all 100 conditions:
+## Example Password
+An example password that satisfies all 100 conditions:

baf1gSUNhiejklmopr5stu$w9c#w!d101b*w934ww0w2

-*Note*: This is a sample; you must craft your own password to meet all rules.
+*Note*: This is a sample; you must craft your own password to meet all rules. Do not use any real or sensitive passwords in this game.

54-58: Clarify evaluation behavior.

The game shows only the first failing condition per attempt; it doesn’t stop the game.

Apply this diff:

-## Notes
-- The game stops at the first failed condition for feedback.
-- Conditions are strict; partial matches don't count.
-- Test carefully to meet all rules.
+## Notes
+- Evaluation reports only the first failing condition per attempt to guide you.
+- Conditions are strict; partial matches don't count.
+- Iterate carefully to meet all rules.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0c1a6d1 and 9e0c192.

📒 Files selected for processing (2)
  • Beginner_Projects/Password_Odyssey_Game/Readme.md (1 hunks)
  • Beginner_Projects/Password_Odyssey_Game/game.py (1 hunks)
🧰 Additional context used
🪛 LanguageTool
Beginner_Projects/Password_Odyssey_Game/Readme.md

[grammar] ~14-~14: There might be a mistake here.
Context: ... and password checking. ## Requirements - Python 3.x - Standard libraries: `string...

(QB_NEW_EN)


[grammar] ~15-~15: There might be a mistake here.
Context: ... checking. ## Requirements - Python 3.x - Standard libraries: string, re ## I...

(QB_NEW_EN)


[grammar] ~32-~32: There might be a mistake here.
Context: ...ype 'quit' to exit. ## Example Password An example password that satisfy all 100...

(QB_NEW_EN)


[grammar] ~46-~46: There might be a mistake here.
Context: ...ase, 10 lowercase, 20 unique characters. - Digits: 8 digits, specific counts (e.g...

(QB_NEW_EN)

🔇 Additional comments (1)
Beginner_Projects/Password_Odyssey_Game/game.py (1)

145-145: Crash risk: .index() raises ValueError when 'SUN' or '101' is absent.

This condition will explode during evaluation (even if earlier conditions fail) because all conditions are evaluated independently. Use .find() or short-circuit guards.

Apply this diff:

-        (lambda p: 'SUN' in p and '101' in p and p.index('SUN') < p.index('101'), "Must contain both 'SUN' and '101', with 'SUN' appearing before '101'"),
+        (lambda p: (p.find('SUN') != -1 and p.find('101') != -1 and p.find('SUN') < p.find('101')), "Must contain both 'SUN' and '101', with 'SUN' appearing before '101'"),

Likely an incorrect or invalid review comment.

Comment thread Beginner_Projects/Password_Odyssey_Game/game.py Outdated
Comment thread Beginner_Projects/Password_Odyssey_Game/game.py Outdated
Comment on lines +124 to +125
(no_run(r"[A-Z]{7}"), "No four consecutive uppercase letters"),
(no_run(r"[aeiouAEIOU]{6}"), "No three consecutive vowels"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Regex quantifiers don’t match the messages (functional bug).

  • Message says “No four consecutive uppercase letters,” but regex looks for 7.
  • Message says “No three consecutive vowels,” but regex looks for 6.

Apply this diff:

-        (no_run(r"[A-Z]{7}"), "No four consecutive uppercase letters"),
-        (no_run(r"[aeiouAEIOU]{6}"), "No three consecutive vowels"),
+        (no_run(r"[A-Z]{4}"), "No four consecutive uppercase letters"),
+        (no_run(r"[aeiouAEIOU]{3}"), "No three consecutive vowels"),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
(no_run(r"[A-Z]{7}"), "No four consecutive uppercase letters"),
(no_run(r"[aeiouAEIOU]{6}"), "No three consecutive vowels"),
(no_run(r"[A-Z]{4}"), "No four consecutive uppercase letters"),
(no_run(r"[aeiouAEIOU]{3}"), "No three consecutive vowels"),
🤖 Prompt for AI Agents
In Beginner_Projects/Password_Odyssey_Game/game.py around lines 124-125, the
regex quantifiers are incorrect for the accompanying messages: change the first
pattern to no_run(r"[A-Z]{4}") so it detects four consecutive uppercase letters
(matching "No four consecutive uppercase letters"), and change the second
pattern to no_run(r"[aeiouAEIOU]{3}") so it detects three consecutive vowels
(matching "No three consecutive vowels"); update those two tuple entries
accordingly.

Comment thread Beginner_Projects/Password_Odyssey_Game/game.py
Comment on lines +154 to +175
def password_game():
print("Welcome to the Password Challenge!")
print("Your password must satisfy 100 unique conditions.")
print("Enter a password, and I'll tell you which conditions you failed.")
print("Type 'quit' to exit.")

conditions = generate_conditions()

while True:
print("\n" + "="*50)
password = input("\nEnter your password: ")
if password.lower() == 'quit':
print("Game ended.")
break

is_valid, failed_conditions, passed_count = check_password(password, conditions)
if is_valid:
print()
print(f"SUCCESS !")
print(f"Your password meets all requirements! (All {passed_count}/100 checks passed)")
print("\n" + "="*50 + "\n")
break

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Does not meet linked issue requirements (no Tkinter/cosmic UI).

The issue (#1716) calls for a tkinter-based, cosmic-themed UI with in-window feedback. This CLI loop doesn’t satisfy that requirement.

Two paths:

  • Implement a minimal Tkinter window that shows progress and the first failing rule, with an “Abandon Mission!” button.
  • If you want to keep this PR focused, update the issue/PR scope to “CLI MVP” and follow up with a UI PR.

I can scaffold a Tkinter UI that reuses generate_conditions() and check_password()—say, a single-window app with an Entry, a Label for status, and a Text/Label for the first failure.

Comment on lines +1 to +6
# Password Challenge

A Python-based game where players create a password.

## Overview
The Password Challenge is an interactive game that tests your ability to craft a password satisfying specific rules. These rules cover length, character types, specific sequences, and patterns. The game provides feedback on failed conditions to guide improvement.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Project naming and scope alignment.

Use “Password Odyssey” consistently and mention that this PR implements a CLI version (pending Tkinter UI from the issue).

Apply this diff:

-# Password Challenge
+# Password Odyssey

-A Python-based game where players create a password.
+A Python-based game where players craft a password that satisfies 100 rules.
+This PR ships a CLI version; a Tkinter-based, cosmic-themed UI (as per issue #1716) can follow as a separate enhancement.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Password Challenge
A Python-based game where players create a password.
## Overview
The Password Challenge is an interactive game that tests your ability to craft a password satisfying specific rules. These rules cover length, character types, specific sequences, and patterns. The game provides feedback on failed conditions to guide improvement.
# Password Odyssey
A Python-based game where players craft a password that satisfies 100 rules.
This PR ships a CLI version; a Tkinter-based, cosmic-themed UI (as per issue #1716) can follow as a separate enhancement.
## Overview
The Password Challenge is an interactive game that tests your ability to craft a password satisfying specific rules. These rules cover length, character types, specific sequences, and patterns. The game provides feedback on failed conditions to guide improvement.
🤖 Prompt for AI Agents
In Beginner_Projects/Password_Odyssey_Game/Readme.md around lines 1 to 6, the
project name and scope are inconsistent: update the title and references to use
“Password Odyssey” everywhere and explicitly state that this PR implements a CLI
version of the game with a pending Tkinter UI noted (reference the related
issue). Edit the overview to reflect the name change, add one sentence like
“This PR implements a CLI version; a Tkinter GUI is pending per issue #X”
(replace #X with the issue number), and ensure wording mentions CLI
implementation and pending GUI consistently.

Comment on lines +44 to +53
## Rules Summary
- **Length**: 32–64 characters, divisible by 2.
- **Letters**: At least 15 letters, 3 uppercase, 10 lowercase, 20 unique characters.
- **Digits**: 8 digits, specific counts (e.g., three '1's, two '0's).
- **Special Characters**: Exactly 4 (`#`, `!`, `*`, `$`).
- **Positional**: Specific characters at positions (e.g., starts with lowercase consonant).
- **Substrings**: Must include 'SUN', '101'; exclude 'love', 'pass', etc.
- **Patterns**: No consecutive digits, vowels, or special characters; no palindromes.
- **Math**: ASCII sum of letters even, digit sum divisible by 5.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Rules summary should match the code (consecutive patterns).

The current text implies “no consecutive digits/vowels/specials” at any length; the code enforces specific thresholds.

Apply this diff:

-- **Patterns**: No consecutive digits, vowels, or special characters; no palindromes.
+- **Patterns**: No four consecutive digits, no four consecutive uppercase letters, no three consecutive vowels, no two consecutive special characters, no palindromes. Also disallow special–digit adjacency in either order and any Uppercase–Digit–Uppercase sequence.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Rules Summary
- **Length**: 32–64 characters, divisible by 2.
- **Letters**: At least 15 letters, 3 uppercase, 10 lowercase, 20 unique characters.
- **Digits**: 8 digits, specific counts (e.g., three '1's, two '0's).
- **Special Characters**: Exactly 4 (`#`, `!`, `*`, `$`).
- **Positional**: Specific characters at positions (e.g., starts with lowercase consonant).
- **Substrings**: Must include 'SUN', '101'; exclude 'love', 'pass', etc.
- **Patterns**: No consecutive digits, vowels, or special characters; no palindromes.
- **Math**: ASCII sum of letters even, digit sum divisible by 5.
## Rules Summary
- **Length**: 32–64 characters, divisible by 2.
- **Letters**: At least 15 letters, 3 uppercase, 10 lowercase, 20 unique characters.
- **Digits**: 8 digits, specific counts (e.g., three '1's, two '0's).
- **Special Characters**: Exactly 4 (`#`, `!`, `*`, `$`).
- **Positional**: Specific characters at positions (e.g., starts with lowercase consonant).
- **Substrings**: Must include 'SUN', '101'; exclude 'love', 'pass', etc.
- **Patterns**: No four consecutive digits, no four consecutive uppercase letters, no three consecutive vowels, no two consecutive special characters, no palindromes. Also disallow special–digit adjacency in either order and any Uppercase–Digit–Uppercase sequence.
- **Math**: ASCII sum of letters even, digit sum divisible by 5.
🧰 Tools
🪛 LanguageTool

[grammar] ~46-~46: There might be a mistake here.
Context: ...ase, 10 lowercase, 20 unique characters. - Digits: 8 digits, specific counts (e.g...

(QB_NEW_EN)

🤖 Prompt for AI Agents
In Beginner_Projects/Password_Odyssey_Game/Readme.md around lines 44 to 53, the
rule "No consecutive digits, vowels, or special characters" is too absolute and
must match the validator's thresholds; update the Rules Summary to state the
exact consecutive limits used by the code (e.g., "No more than 2 consecutive
digits, no more than 2 consecutive vowels, and no more than 2 consecutive
special characters") and clarify that the palindrome restriction and
positional/substrings rules apply to the entire password as implemented; replace
the current blanket wording with these precise limits so the README mirrors the
validation logic.

@github-actions

Copy link
Copy Markdown

✅ PR validation passed! Syncing labels and assignees from the linked issue...

1 similar comment
@github-actions

Copy link
Copy Markdown

✅ PR validation passed! Syncing labels and assignees from the linked issue...

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (4)
Beginner_Projects/Password_Odyssey_Game/game.py (2)

45-46: Empty-input guard for last-char check — good catch, keep it.

The len(p) >= 1 guard prevents IndexError when users submit an empty string.


103-104: Make both ‘e’ rules consistent and case-insensitive.

Right now the “at least one ‘e’” is case-insensitive but the “at most two” only counts lowercase ‘e’. Either the intent is case-insensitive for both, or the messages should explicitly say “lowercase.” Suggest making both checks case-insensitive to match user expectations.

-        (lambda p: p.lower().count('e') >= 1, "Must contain at least one 'e'"),
-        (lambda p: p.count('e') <= 2, "Must contain at most two lowercase 'e' letters"),
+        (lambda p: p.lower().count('e') >= 1, "Must contain at least one 'e' (case-insensitive)"),
+        (lambda p: p.lower().count('e') <= 2, "Must contain at most two 'e' letters (case-insensitive)"),
Beginner_Projects/Password_Odyssey_Game/Readme.md (2)

1-7: Use “Password Odyssey” consistently and clarify it’s a CLI.

Align name and scope throughout the file; the Overview currently says “Password Challenge.”

-# Password Odyssey
-
-A Python-based game where players try to create a password following several conditions.
+# Password Odyssey
+
+A Python-based CLI game where players craft a password that satisfies 100 rules.
@@
-## Overview
-The Password Challenge is an interactive game that tests your ability to craft a password satisfying specific rules. These rules cover length, character types, specific sequences, and patterns. The game provides feedback on failed conditions to guide improvement.
+## Overview
+Password Odyssey is an interactive CLI game that tests your ability to craft a password satisfying 100 specific rules. These rules cover length, character types, specific sequences, and patterns. The game provides feedback on the first failed condition to guide improvement.

44-53: Rules summary must match validators (thresholds and patterns).

The current text says “No consecutive digits, vowels, or special characters,” which doesn’t reflect the actual limits (e.g., “no four consecutive …”). Also include adjacency and sequence bans present in code.

 ## Rules Summary
 - **Length**: 32–64 characters, divisible by 2.
 - **Letters**: At least 15 letters, 3 uppercase, 10 lowercase, 20 unique characters.
 - **Digits**: 8 digits, specific counts (e.g., three '1's, two '0's).
 - **Special Characters**: Exactly 4 (`#`, `!`, `*`, `$`).
 - **Positional**: Specific characters at positions (e.g., starts with lowercase consonant).
 - **Substrings**: Must include 'SUN', '101'; exclude 'love', 'pass', etc.
-- **Patterns**: No consecutive digits, vowels, or special characters; no palindromes.
+- **Patterns**: No four consecutive digits, no four consecutive uppercase letters, no four consecutive vowels, no two consecutive special characters; no whitespace; no uppercase–digit–uppercase sequence; no special–digit adjacency in either order; no character may repeat three times consecutively; no palindromes.
 - **Math**: ASCII sum of letters even, digit sum divisible by 5.
-- **and many such hidden rule**
+- **Notes**: Some letter-frequency limits are enforced (e.g., ‘a’, ‘o’, ‘i’, ‘u’ at most twice; ‘e’ limits—see code).
🧹 Nitpick comments (11)
Beginner_Projects/Password_Odyssey_Game/game.py (9)

134-137: Frequency limits for vowels count only lowercase — align rule and message.

These constraints currently miss uppercase letters (e.g., ‘A’ isn’t counted toward the limit). Either update messages to say “lowercase,” or count case-insensitively. Recommending the latter for consistency with other rules.

-        (lambda p: p.count('a') <= 2, "Letter 'a' can appear at most twice"),
-        (lambda p: p.count('o') <= 2, "Letter 'o' can appear at most twice"),
-        (lambda p: p.count('i') <= 2, "Letter 'i' can appear at most twice"),
-        (lambda p: p.count('u') <= 2, "Letter 'u' can appear at most twice"),
+        (lambda p: p.lower().count('a') <= 2, "Letter 'a' (case-insensitive) can appear at most twice"),
+        (lambda p: p.lower().count('o') <= 2, "Letter 'o' (case-insensitive) can appear at most twice"),
+        (lambda p: p.lower().count('i') <= 2, "Letter 'i' (case-insensitive) can appear at most twice"),
+        (lambda p: p.lower().count('u') <= 2, "Letter 'u' (case-insensitive) can appear at most twice"),

123-131: Pattern thresholds: docs must match the code (vowels = 4).

The validators enforce “no four consecutive digits/uppercase/vowels.” Ensure the README uses the same thresholds (currently says “No consecutive …” without limits).

We propose a README update below.


170-171: Avoid hard-coding “100” — derive total from the conditions length.

This keeps UI output accurate if rules are added/removed later.

-    conditions = generate_conditions()
+    conditions = generate_conditions()
+    total = len(conditions)

181-185: Fix f-string lint and show dynamic totals in success output.

  • Remove the pointless f prefix on a static string (Ruff F541).
  • Replace hard-coded 100 with the computed total.
-            print()
-            print(f"SUCCESS !")
-            print(f"Your password meets all requirements! (All {passed_count}/100 checks passed)")
-            print("\n" + "="*50 + "\n")
+            print()
+            print("SUCCESS!")
+            print(f"Your password meets all requirements! (All {passed_count}/{total} checks passed)")
+            print("\n" + "=" * 50 + "\n")

188-191: Print only the first failure without an unused loop variable.

Avoids the unused variable warning (B007) and reads clearer.

-            print(f"Progress: {passed_count}/100 checks passed.")
-            for i, failure in enumerate(failed_conditions):
-                print(f"NOTE: {failure}")
-                break
+            print(f"Progress: {passed_count}/{total} checks passed.")
+            if failed_conditions:
+                print(f"NOTE: {failed_conditions[0]}")

6-7: Optional: precompile regexes for the no_run helpers.

Not required for such short inputs, but compiling once avoids recompilation on every check and keeps the pattern semantics explicit.

-    def no_run(regex):
-        return lambda p: re.search(regex, p) is None
+    def no_run(regex):
+        pattern = re.compile(regex)
+        return lambda p: pattern.search(p) is None

60-69: Special-character rules are redundant but harmless; consider simplifying.

You already enforce “only # ! * $” and exactly one of each, so individual “must not contain” checks for other punctuation are superfluous. Removing them trims noise without changing behavior.


2-2: Nit: trailing whitespace after import.

import re has a trailing space.

-import re 
+import re

149-163: Optionally include exception details in internal-error messages.

Helps authors debug a faulty predicate quickly.

-        except Exception:
-            failed.append(f"[{idx}] Internal error while checking: {msg}")
+        except Exception as e:
+            failed.append(f"[{idx}] Internal error while checking: {msg} ({e})")
Beginner_Projects/Password_Odyssey_Game/Readme.md (2)

18-24: Clarify run command path (from repo root) and keep local option.

Avoid confusion for users running from the repo root.

-3. Run the script:
+3. Run the script:
    ```bash
-   python game.py
+   # From this folder:
+   python game.py
+   # Or from the repo root:
+   python Beginner_Projects/Password_Odyssey_Game/game.py
    ```

32-37: Grammar and fenced code language.

  • “satisfy” → “satisfies”
  • Provide a language for the fenced block (markdownlint MD040).
-## Example Password
-An example password that satisfy all 100 conditions:
-```
+## Example Password
+An example password that satisfies all 100 conditions:
+```text
 baf1gSUNhiejklmopr5stu$w9c#w!d101b*w934ww0w2

-Note: This is a sample; you must craft your own password to meet all rules.
+Note: This is a sample; you must craft your own password to meet all rules.


</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used**: CodeRabbit UI

**Review profile**: CHILL

**Plan**: Pro

**💡 Knowledge Base configuration:**

- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 9e0c1926b5e63bfe44d6c8782345dcef64e1f473 and add73d4adb80d3b20124d9519147533490f8f37a.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `Beginner_Projects/Password_Odyssey_Game/Readme.md` (1 hunks)
* `Beginner_Projects/Password_Odyssey_Game/game.py` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 LanguageTool</summary>

<details>
<summary>Beginner_Projects/Password_Odyssey_Game/Readme.md</summary>

[grammar] ~14-~14: There might be a mistake here.
Context: ... and password checking.  ## Requirements - Python 3.x - Standard libraries: `string...

(QB_NEW_EN)

---

[grammar] ~15-~15: There might be a mistake here.
Context: ... checking.  ## Requirements - Python 3.x - Standard libraries: `string`, `re`  ## I...

(QB_NEW_EN)

---

[grammar] ~32-~32: There might be a mistake here.
Context: ...ype 'quit' to exit.  ## Example Password An example password that satisfy all 100...

(QB_NEW_EN)

---

[grammar] ~46-~46: There might be a mistake here.
Context: ...ase, 10 lowercase, 20 unique characters. - **Digits**: 8 digits, specific counts (e.g...

(QB_NEW_EN)

---

[grammar] ~52-~52: There might be a mistake here.
Context: ...f letters even, digit sum divisible by 5. - **and many such hidden rule**  ## Notes - ...

(QB_NEW_EN)

</details>

</details>
<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

<details>
<summary>Beginner_Projects/Password_Odyssey_Game/Readme.md</summary>

34-34: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>
<details>
<summary>🪛 Ruff (0.12.2)</summary>

<details>
<summary>Beginner_Projects/Password_Odyssey_Game/game.py</summary>

182-182: f-string without any placeholders

Remove extraneous `f` prefix

(F541)

---

189-189: Loop control variable `i` not used within loop body

Rename unused `i` to `_i`

(B007)

</details>

</details>

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@SHIV-360

Copy link
Copy Markdown
Contributor Author

@UTSAVS26 requesting merge all outlined points are not necessary or does not follow the game rule if made the changes

@UTSAVS26
UTSAVS26 merged commit 7d219f5 into UTSAVS26:main Aug 23, 2025
@UTSAVS26 UTSAVS26 added Status: Approved ✔️ PRs that have passed review and are approved for merging. Intermediate and removed Status: Review Ongoing 🔄 PR is currently under review and awaiting feedback from reviewers. level1 labels Aug 23, 2025
@SHIV-360
SHIV-360 deleted the password-odyssey-game branch August 24, 2025 09:02
@coderabbitai coderabbitai Bot mentioned this pull request Aug 24, 2025
18 of 21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Contributor Denotes issues or PRs submitted by contributors to acknowledge their participation. Intermediate SSoC25 Status: Approved ✔️ PRs that have passed review and are approved for merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project Addition Password Odyssey

2 participants