Implements the stripping routine> Everything is sequential, but as we dont have much data this is not really an issue

This commit is contained in:
julien lengrand-lambert
2013-09-11 16:17:24 +02:00
parent 817c2b8683
commit 8fe580e24d

23
e_54.py
View File

@@ -38,13 +38,32 @@ def load_data(filename):
file.close()
return hands
def sort_n_strip(hands):
"""
As description indicates data is correct, we can ignore the color of the
cards. (and hence strip the value)
We also want to sort the players hands (to be worked with easier later)
"""
# just keeping the first element of the cards
stripped_hands = [[[val[0] for val in h] for h in hand] for hand in hands]
sorted_hands = stripped_hands
#need to sort now
return sorted_hands
def winning_hands(filename):
"""
Returns the first of the firs num consecutive primes.
"""
hands = load_data(filename)
for val in hands:
print val
data = sort_n_strip(hands)
print hands
print data
#for val in hands:
#print val
if __name__ == '__main__':
winning_hands("./e_54_poker.txt")