Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create mentoring.md #2366

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Create mentoring.md #2366

wants to merge 1 commit into from

Conversation

j-abed
Copy link

@j-abed j-abed commented Jan 20, 2025

Create a mentoring.md file for the python practice exercise: "Poker"

This pull request includes the creation of/ a comprehensive update to the tracks/python/exercises/poker/poker/mentoring.md file. The changes focus on explaining the key components of the poker hand evaluation code, detailing the logic and efficiency improvements, and providing a summary of the overall approach.

Key components and improvements explained:

  • Card Values: Introduced a dictionary CARD_VALUES to map card ranks to numerical values for easier comparisons.
  • Parsing Hands: Added the parse_hand function to process a poker hand, extracting sorted values and checking for a flush.
  • Checking for Straight: Implemented the is_straight function to check if card values form a consecutive sequence.
  • Ranking Hands: Detailed the rank function, which assigns a rank and relevant details to a hand using a match-case statement for different hand combinations.
  • Determining the Best Hand(s): Explained the best_poker_hands function to identify the highest-ranking hand(s) among a list of hands.

Efficiency and optimization improvements:

  • Consolidated Parsing: Combined common operations in parse_hand to improve efficiency.
  • Reduced Repetition: Reused computed values, flush, and straight checks to minimize redundant calculations.
  • **poker"

@github-actions github-actions bot added the track/python Python track label Jan 20, 2025
@IsaacG
Copy link
Member

IsaacG commented Jan 20, 2025

You may want to review other mentoring notes. This PR looks like a walk through of one specific implementation. The mentor notes are supposed to contain notes mentors can use when mentoring solutions; it is not a place to show off any one specific solution.

@j-abed
Copy link
Author

j-abed commented Jan 20, 2025 via email

@IsaacG
Copy link
Member

IsaacG commented Jan 20, 2025

The mentoring notes aren't about helping mentors solve the exercise, either :) It's fair to assume mentors already know how to solve the exercise and probably have solved it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
track/python Python track
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants