Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7746047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:10:39+00:00 2026-06-01T10:10:39+00:00

Is it possible to extract that info from the equivalence value? I understand that

  • 0

Is it possible to extract that info from the equivalence value?

I understand that the higher the equivalence value the better. Category and rank can also be extracted from the equivalence value. But is there a way to find out what the best 5 cards combination are from the 7 that you passed to it?

Twoplustwo is the fastest poker hand evaluator around (14-15 million hands evaluated per second). You give your 7 cards to it and it spits out a hand equivalence value. The higher the value, the better is card is.

Here’s a great summary on twoplustwo: http://www.codingthewheel.com/archives/poker-hand-evaluator-roundup#2p2

Cached version of the link above:
http://web.archive.org/web/20130116102452/http://www.codingthewheel.com/archives/poker-hand-evaluator-roundup

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:10:41+00:00Added an answer on June 1, 2026 at 10:10 am

    (disclaimer: I’m working on a poker software that does, amongst other, hand evaluations)

    You give your 7 cards to it and it spits out a hand equivalence value.

    there are several evaluators doing that and if I’m not mistaken some of them compute more than a hundred million hands per second (!). These evaluators basically come down to 7 array lookups in a gigantic array and it only takes a few cycles (despite the cache misses) to evaluate a hand. I don’t think 14-15 millions / second is anywhere near the fastest. CactusKev’s evaluator is 10x faster if I’m not mistaken.

    Now to answer your question:

    how do you get the best 5 cards combination out of the 7 that you
    passed to it?

    Well it doesn’t tell you but once you have the strength of the hand it can become very easy: you don’t need to re-invent the wheel.

    You can use the strength to simplify your “best five out of seven” computation.

    You could also use other libraries, giving your directly the five best card (instead of just their strength) or you can use the strength to find the five best cards yourself.

    I’ll just give a few examples…

    • You know you have a full house (a.k.a. a “boat”), then you know that you’re looking for three cards that have the same rank and then the best pair (if there are two pairs, but you’re sure to find at least one, because the evaluator told you you have a boat).

    • You know you have a straight: find five cards that follow each other, starting from the best one (beware of the special wheel case case).

      You could also get a bit fancier for the straight: you could take the strength of every possible straight and compare the strength that the evaluator gives you with these. If it matches, say, a ten-high straight, then simply look for any T, 9, 8, 7 and 6 card (no matter the suit).

    • You know you have “no pair”: simply take the five highest card you find

    • etc.

    There are only a few different ranks… They could be, for example:

    NO_PAIR
    ONE_PAIR
    TWO_PAIRS
    SET
    STRAIGHT
    FLUSH
    FULL_HOUSE
    FOUR_OF_A_KIND
    STRAIGHT_FLUSH
    

    (you could of course create intermediate “wheel straight” and “wheel straight flush” and “royal flush” cases if you want, etc.)

    Once you know the which type of hand your hand is (thanks to the fast evaluator you’re using), simply switch to a piece of code that finds the five best out of seven for that particular hand.

    I think it’s a good way to proceed because you leverage the ultra-fast evaluator and it then greatly simplifies your logic.

    At startup, you’d need to compute the strenth once, for example by computing:

    HIGHEST_NO_PAIR_HAND = ultraFastEvaluator( "As Kd Qh Jc 9d 5s 2c" );
    
    HIGHEST_FULL_HOUSE = ultraFastEvaluator( "As Ac Ad Kh Ks 8s 2h" );
    

    I’m of course not advocating to use strings here. It’s just an example…

    You could then, for each hand you want to find the actual five best:

    • compute the strength using the fast evaluator
    • is it <= HIGHEST_NO_PAIR_HAND ?
      • yes: take five highest cards
      • no: is it <= HIGHEST_ONE_PAIR_HAND ?
        yes: take highest pair + highest three cards
        no: is it <= HIGHEST_TWO_PAIRS_HAND?

        • etc.

    So in my opinion you could reuse an API that directly finds the five best out of seven or entirely rewrite your own, but it’s going to faster if you use the fast evaluator’s result to then simplify your logic.

    EDIT note that there’s not necessarily one way to do “five best out of seven”. For example with As Ac on a Kc Kd Qh Qs 2c board, both “As Ac Kc Kd Qh” and “As Ac Kc Kd Qs” are “five best” (the last queen’s suit doesn’t matter).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I discovered that it is possible to extract the hard-coded strings from a binary.
is that possible to extract out all the data in second sheet from each
Is it possible to extract all of the VBA code from a Word 2007
Is it possible to extract a single file or diff of a file from
is it possible to extract dynamic loaded text from a swf (flash application) programatically
Is it possible to extract a script from an MySQL database to create a
I have a process that extracts customer info from multiple databases (MySql) based on
I have a process that extracts customer info from multiple databases (MySql) based on
Is it possible to extract chart information from an Office 2007 (xlsx / OpenXML)
Possible Duplicates: Remove duplicates in large MySql table Can I extract the extract records

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.