Ejemplo n.º 1
0
def createEvalCSV():
	allCards = []
	for num in xrange(2,15):
		for suit in ['c','d','h','s']:
			allCards.append((num, suit))
	translationDict = loadTranslationDict()
	allHands = combinations(allCards,5)

	handFile = open('handFile.csv', 'wt')
	writer = csv.writer(handFile)
	for hand in allHands:
		hand = sorted(hand, key= lambda x: (x[0], x[1]), reverse = True)
		handValue = PP.findHandValue(hand)
		handString = ''
		for card in hand:
			key = str(card[0]) + card[1]
			handString += translationDict[key]
		handValueString = ''
		for num in handValue:
			if num < 10: addHand = "0" + str(num)
			else: addHand = str(num)
			handValueString += addHand
		writer.writerow((handString , handValueString))
	handfile.close()
	return 0
Ejemplo n.º 2
0
def createEvalCSV():
	allCards = []
	for num in xrange(2,15):
		for suit in ['c','d','h','s']:
			allCards.append((num, suit))
	translationDict = loadTranslationDict()
	allHands = combinations(allCards,5)

	handFile = open('handFile.csv', 'wt')
	writer = csv.writer(handFile)
	for hand in allHands:
		hand = sorted(hand, key= lambda x: (x[0], x[1]), reverse = True)
		handValue = PP.findHandValue(hand)
		handString = ''
		for card in hand:
			key = str(card[0]) + card[1]
			handString += translationDict[key]
		handValueString = ''
		for num in handValue:
			if num < 10: addHand = "0" + str(num)
			else: addHand = str(num)
			handValueString += addHand
		writer.writerow((handString , handValueString))
	handfile.close()
	return 0