Update rules

This commit is contained in:
theta00 2023-02-02 00:37:40 +01:00
parent 1e0f50c1a7
commit dfca353b2a

View File

@ -194,6 +194,11 @@ def getHardHandDecision(dealerCard, playerCardsVal, playerCardsNum):
"IF (playerCardsValue IS medium) AND (dealerCardValue IS high) THEN (decision IS hit)",
"IF (playerCardsValue IS medium) AND (dealerCardValue IS very_high) THEN (decision IS hit)",
"IF (playerCardsValue IS high) AND (dealerCardValue IS very_high) THEN (decision IS hit)",
"IF (playerCardsValue IS very_high) THEN (decision IS stand)",
"IF (playerCardsValue IS high) AND (dealerCardValue IS high) THEN (decision IS stand)",
"IF (playerCardsValue IS medium) AND (dealerCardValue IS low) THEN (decision IS stand)",
"IF (playerCardsValue IS high) AND (dealerCardValue IS low) THEN (decision IS stand)",
"IF (playerCardsValue IS very_high) AND (dealerCardValue IS low) THEN (decision IS stand)",
])
else:
@ -202,6 +207,11 @@ def getHardHandDecision(dealerCard, playerCardsVal, playerCardsNum):
"IF (playerCardsValue IS medium) AND (dealerCardValue IS high) THEN (decision IS hit)",
"IF (playerCardsValue IS medium) AND (dealerCardValue IS very_high) THEN (decision IS hit)",
"IF (playerCardsValue IS high) AND (dealerCardValue IS very_high) THEN (decision IS hit)",
"IF (playerCardsValue IS very_high) THEN (decision IS stand)",
"IF (playerCardsValue IS high) AND (dealerCardValue IS high) THEN (decision IS stand)",
"IF (playerCardsValue IS medium) AND (dealerCardValue IS low) THEN (decision IS stand)",
"IF (playerCardsValue IS high) AND (dealerCardValue IS low) THEN (decision IS stand)",
"IF (playerCardsValue IS very_high) AND (dealerCardValue IS low) THEN (decision IS stand)",
])
@ -288,6 +298,11 @@ def getSoftHandDecision(dealerCard, playerCardsVal, playerCardsNum):
"IF (playerCardsValue IS medium) AND (dealerCardValue IS high) THEN (decision IS hit)",
"IF (playerCardsValue IS medium) AND (dealerCardValue IS very_high) THEN (decision IS hit)",
"IF (playerCardsValue IS high) AND (dealerCardValue IS very_high) THEN (decision IS hit)",
"IF (playerCardsValue IS very_high) THEN (decision IS stand)",
"IF (playerCardsValue IS high) AND (dealerCardValue IS high) THEN (decision IS stand)",
"IF (playerCardsValue IS medium) AND (dealerCardValue IS low) THEN (decision IS stand)",
"IF (playerCardsValue IS high) AND (dealerCardValue IS low) THEN (decision IS stand)",
"IF (playerCardsValue IS very_high) AND (dealerCardValue IS low) THEN (decision IS stand)",
])
else:
@ -296,6 +311,11 @@ def getSoftHandDecision(dealerCard, playerCardsVal, playerCardsNum):
"IF (playerCardsValue IS medium) AND (dealerCardValue IS high) THEN (decision IS hit)",
"IF (playerCardsValue IS medium) AND (dealerCardValue IS very_high) THEN (decision IS hit)",
"IF (playerCardsValue IS high) AND (dealerCardValue IS very_high) THEN (decision IS hit)",
"IF (playerCardsValue IS very_high) THEN (decision IS stand)",
"IF (playerCardsValue IS high) AND (dealerCardValue IS high) THEN (decision IS stand)",
"IF (playerCardsValue IS medium) AND (dealerCardValue IS low) THEN (decision IS stand)",
"IF (playerCardsValue IS high) AND (dealerCardValue IS low) THEN (decision IS stand)",
"IF (playerCardsValue IS very_high) AND (dealerCardValue IS low) THEN (decision IS stand)",
])
@ -340,7 +360,9 @@ def getDecision(dealerCard, playerCards, isPair):
Returns:
str: decision
"""
print(dealerCard)
print(playerCards)
print(isPair)
playerCardsNum = len(playerCards)
if 1 in playerCards: # soft hand
playerCardsVal = sum([x if x != 1 else 10 for x in playerCards])