Пример #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(D1.dealer_name)
print(D1.dealer_name.upper())

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

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

print(D1.get_ranks())

print(CardDeck.get_ranks())
print("=" * 40)
J1 = JokerDeck("Beulah")
print(J1)
J1.shuffle()
print(J1.cards)

print(JokerDeck.mro())
J1.register_scores()

J1.doit()
print(J1.dealer_name)

print(len(D1), len(J1))


print(dir(object))
print(sys.getsizeof(object))
print(sys.getsizeof(J1))
Пример #4
0
    print(c1.dealer)

print()
c1.shuffle()
print(c1.cards)
print()

print(len(c1))
print(c1)

print(c1.get_suits())

print(CardDeck.get_suits())

c1.bark()
print()
j = JokerDeck("Fred")

print(j)
print(len(j))
j.shuffle()
print(j.cards)

j.bark()

j.meow()

print(JokerDeck.mro())