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

Add poker exercise #142

Merged
merged 1 commit into from
Oct 9, 2024
Merged

Add poker exercise #142

merged 1 commit into from
Oct 9, 2024

Conversation

ageron
Copy link
Contributor

@ageron ageron commented Oct 9, 2024

A couple things tripped me up:

  • Ace, 2, 3, 4, 5 is the smallest straight
  • 2, 2, Q, K, A is smaller than 3, 3, 4, 5, 6: you must compare the biggest groups first.

I started by implementing a function to compare two hands, but I found it easier to implement a function that just returns a hand overall rank, and then simply keep the hand(s) with the highest rank.

Copy link
Contributor

@isaacvando isaacvando left a comment

Choose a reason for hiding this comment

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

Very nice!

@isaacvando isaacvando merged commit 7f8034b into exercism:main Oct 9, 2024
4 checks passed
@ageron ageron deleted the add-poker branch October 9, 2024 19:25
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