From 519824caee312f9b1c96006cdbdace70460c48d5 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Thu, 1 Apr 2010 03:59:16 +0000 Subject: [PATCH] Allowing a hand to be anything between 1 and 5 cards. This will allow for improvement probability calculations and such, as well as ranking smaller hands for games like chinese poker. git-svn-id: file:///srv/svn/euler@13 e5f4c3ec-3c0c-11df-b522-21efaa4426b5 --- 054/poker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/054/poker.py b/054/poker.py index 27f6ffa..74382af 100644 --- a/054/poker.py +++ b/054/poker.py @@ -62,7 +62,7 @@ class Hand: 'Royal Flush' ] def __init__(self, cards): - if len(cards) != 5: + if len(cards) < 1 or len(cards) > 5: raise InvalidHand(cards) self.__rank = None self.__cards = sorted([Card(c) for c in cards], reverse=True)