From dfca353b2a0e89d0f9a5fbff54c16f70dca0e8a7 Mon Sep 17 00:00:00 2001 From: theta00 <72700814+theta00@users.noreply.github.com> Date: Thu, 2 Feb 2023 00:37:40 +0100 Subject: [PATCH] Update rules --- FuzzyControlSystem.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/FuzzyControlSystem.py b/FuzzyControlSystem.py index a65fac5..6e623db 100644 --- a/FuzzyControlSystem.py +++ b/FuzzyControlSystem.py @@ -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])