1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-22 03:04:09 -04:00

Update simplex.py according to tests

This commit is contained in:
Sandeepa Dilshan Alagiyawanna 2024-10-24 10:10:39 +05:30 committed by GitHub
parent 87116badd9
commit 42ad6e5e90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,6 +36,7 @@ from pysollib.util import ANY_RANK, ANY_SUIT
# * Simplex
# ************************************************************************
# Helper function to check if all cards in a sequence have the same rank
def isSameRankSequence(cards):
c0 = cards[0] # Get the rank of the first card
@ -49,7 +50,7 @@ def isSameRankSequence(cards):
class Simplex_Foundation(AbstractFoundationStack):
# Function to check if group of cards can be accepted into the foundation
def acceptsCards(self, from_stack, cards):
if len(cards) != 4: #Foundation only accepts exactly 4 cards at time
if len(cards) != 4:
return False
return isSameRankSequence(cards) # Cards must be of the same rank