initial call from deckj

This commit is contained in:
2026-01-29 11:59:53 -05:00
parent 1a10b098c1
commit 5deb53ac9c

View File

@@ -27,4 +27,24 @@ class Deck:
return card
def number_of_cards(self) -> int:
return len(self._cards) - self._next_card
return len(self._cards) - self._next_card
if __name__ == "__main__":
deck = Deck()
print("Initial deck:")
for card in deck._cards:
print(card)
deck.shuffle()
print("\nShuffled deck:")
for card in deck._cards:
print(card)
print("\nDealing cards:")
while True:
card = deck.deal()
if card is None:
break
print(card)
print(f"\nNumber of cards left in deck: {deck.number_of_cards()}")