Project Euler problem 54

I’m starting on Project Euler to help myself learn Python better.  Project Euler offers a great range of problems that sit in the realm between math and programming.  I finally solved problem 54 tonight, which involves judging poker hands.  A couple of observations that helped me finish the problem were:

  1. Breaking ties between hands of the same value only sometimes requires high card evaluation.   E.g. when comparing four of a kind, three of a kind, or full house, there is no need to check any other cards besides the melded cards.
  2. Royal flush and Straight flush require the same evaluation.PythonEssentialReference

After looking at a lot of Python books and wishing for something up to date, I found Python: Essential Reference fourth edition by Beazley.  It has good coverage of both 2.6 and 3.0, and the author comes from a scientific background as well.

Advertisements
Explore posts in the same categories: Books, Uncategorized

One Comment on “Project Euler problem 54”

  1. Marco Cecconi Says:

    Haven’t done that one yet, but it seems wicked! Congratulations 🙂


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: