示例#1
0
def main():
    """
    Program entry point

    :return: None
    """
    deck1 = CardDeck('Nellie')  # instantiate
    print(deck1)

    deck2 = CardDeck('Andy')
    deck3 = CardDeck('Rosie')

    # deck1.some_method()
    # deck1.some_property

    print(deck1.dealer)  # deck1.dealer() line 9

    deck1.dealer = "Frodo"  # deck1.dealer() line 13

    print(deck1.dealer)

    try:
        deck1.dealer = 1234
    except TypeError as err:
        print(err)

    print(deck1.dealer, deck2.dealer, deck3.dealer)

    deck1.shuffle()
    print(deck1.cards)
    print()

    for _ in range(5):
        rank, suit = deck1.draw()
        print(f"{rank} of {suit}")

    jokerdeck1 = JokerDeck("Alicia")
    jokerdeck2 = JokerDeck("Ferdinand")

    print(jokerdeck1)
    jokerdeck1.shuffle()
    print(jokerdeck1.cards)
    print(jokerdeck1.draw())

    print(deck1)  # print(str(deck1))
    print(jokerdeck1, deck1, jokerdeck2, deck2)
示例#2
0
print(d1.dealer)

# print(d1.get_dealer())
# d1.set_dealer("Brenda")

d1.shuffle()
print(d1.cards, '\n')

for i in range(7):
    print(d1.draw())
print()

print(d1.get_ranks())

print(CardDeck.get_ranks())
print('-' * 60)

j1 = JokerDeck("Albert")
j1.shuffle()
print(j1.draw())
print(j1.cards)

j1.bark()

end_time = time.time()

print("elapsed time:", end_time - start_time)


示例#3
0
print(C1.cards)

hand = []
for i in range(5):
    hand.append(C1.draw())
print("Hand:", hand)

print(C1.get_suits())
print(CardDeck.get_suits())

CardDeck.bark()
print('-' * 60)
J1 = JokerDeck('Jack')
print(J1)
print(J1.draw())
print(J1.cards)

J1.bark()
print(JokerDeck.mro())
print(J1)  # print(str(j1))
print(C1)
print(len(J1))  #  print(str(len(j1)))
print(len(C1))
c2 = CardDeck("Bonnie")

Z = C1 + c2

print(Z)
print(len(Z))
print(Z.draw())