Beispiel #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)
Beispiel #2
0
d1.shuffle()
print(d1.cards)

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

print(d1.get_ranks())
print(CardDeck.get_ranks())

CardDeck.yell()
d1.yell()

j1 = JokerDeck("Ally")
print(j1)  # print(str(j1))
j1.shuffle()
print(j1.cards)

print(CardDeck.mro())
print(JokerDeck.mro())

print(len(d1), len(j1))

print(repr(d1), repr(j1))

new_deck = d1 + j1

print(new_deck)
new_deck.shuffle()
Beispiel #3
0
#!/usr/bin/env python

from carddeck import CardDeck
from jokerdeck import JokerDeck

d1 = CardDeck("Bob")

print(d1)
print(d1.dealer)

d1.shuffle()
print(d1.cards)

hand = []

for i in range(5):
    hand.append(d1.draw())

print(hand)

d2 = CardDeck("Linda")

j1 = JokerDeck("Beth")

j1.shuffle()

print(j1.cards)
Beispiel #4
0
    print(err)

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(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())


Beispiel #6
0
# print(str(x))

print(d1.get_suits())
print(CardDeck.get_suits())

d2 = CardDeck("Frodo")
d3 = CardDeck("Rosie")
d4 = CardDeck("Seamus")

print(CardDeck.get_count())
print(d1.get_count())

print(CardDeck.add(10, 5))
print('-' * 60)

j1 = JokerDeck("Fred")
print(j1)
j1.shuffle()
print(j1.cards)
print(j1.get_strategy())

print(JokerDeck.mro())
print(j1.get_it())

print(len(d1), len(j1))

print(d1)
print(j1)
print()

print(repr(d1))
Beispiel #7
0
    print(err)
else:
    print(d1.dealer)

d1.shuffle()
print(d1.cards)

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

print(d1.get_ranks())
print()

print(CardDeck.get_ranks())

print(len(d1))
print(len(d2))

print(d1)

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

print(CardDeck.mro())
print()
print(JokerDeck.mro())
Beispiel #8
0
    d1.dealer = 123.456
except TypeError as err:
    print(err)
print()

d1.shuffle()
print(d1.cards)
print()
for i in range(5):
    print(d1.draw())
print()

print(str(d1))  # print calls str()
print(d1)
print(len(d1))
print(repr(d1))

d2 = CardDeck("Roderick")

x = d1 + d2

print(x, '\n')

j1 = JokerDeck('James')
j1.shuffle()
print(j1)
print(j1.cards, '\n')
print(j1.game_id())

print(JokerDeck.mro())
Beispiel #9
0
print(d1.dealer)

d1.set_dealer('Fred')
print(d1.dealer)

print(d1)

print(d1.get_suits())

print(CardDeck.get_suits())


CardDeck.scream()
d1.scream()

j1 = JokerDeck("Alfred")
print(j1.dealer)
j1.shuffle()
print(j1)
print()

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

j1.beep()

print(CardDeck.mro())
print(JokerDeck.mro())

print(len(d1), len(j1))
print(d1, j1)   # print(str(d1), str(j1)
Beispiel #10
0
c1.doit("up", "down")
print("c2:", c2)
c2.doit("yes", "no")

print(CardDeck.SUITS)
print(c1.get_suits())
print(CardDeck.get_suits())

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

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

j1 = JokerDeck('Anushka')
j1.shuffle()
print(j1.cards)
for i in range(3):
    print(j1.draw())

print(JokerDeck.mro())
j1.doit()
print(len(c1), len(j1))

# print(CardDeck.__len__(c1))

print(c1)  # print(str(c1))
print(j1)
print(repr(c1))
print(repr(j1))
Beispiel #11
0
print(cd1.cards)

print(cd1.get_ranks())

print(CardDeck.get_ranks())

CardDeck.say_hello()
other_method()

print(dir(CardDeck))
print()

cd2 = CardDeck("Miranda")

j1 = JokerDeck("Alicia")
print(j1)
j1.shuffle()
print(j1.cards)
print()

j1.strategy()

print(JokerDeck.mro())

j1.wombat()

print(len(cd1))
print(len(cd2))
print(len(j1))  # j1.__len__()
# print(j1.__len__())  wrong
Beispiel #12
0
    print(err)
else:
    print(d3)

d1.shuffle()
print(d1.cards)

for _ in range(10):
    print(d1.draw())
print()

# for _ in range(50):
#     print(d1.draw())

print(len(d1))

print(d1)
# print(str(d1))

print(repr(d1))

d4 = d1 + d2

print(d4)

j1 = JokerDeck("Frank")
print(j1)
print(JokerDeck.mro())
j1.shuffle()
print(j1.cards)
Beispiel #13
0
    print(err)
else:
    print(d2)

d3 = CardDeck("Susan")
d1.shuffle()
print(d1.cards)

hand = []
for i in range(5):
    card = d1.draw()
    hand.append(card)

print(hand)
print(d1.get_suits())
print(CardDeck.get_suits())
print('-' * 60)
j1 = JokerDeck('Laura')
print(j1.dealer)
j1.shuffle()
print(j1.cards)

print(len(d1))
print(d1)
print(j1)

x = d1 + j1
print(x)
y = j1 + d1
print(y)
Beispiel #14
0
print(CardDeck)
print(d1)

print(d1.dealer)

d1.dealer = 'foo'

print(d1.dealer)

d1.shuffle()
print(d1.cards)

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

print(len(d1))
print(int(d1))
print(d1.get_suits())
print(CardDeck.get_suits())
print('-' * 60)
j1 = JokerDeck('Elaine')
print(j1)
j1.shuffle()
print(j1.cards)
j1.bark()

print(CardDeck.mro())
print(JokerDeck.mro())
Beispiel #15
0
d1.shuffle()
print(d1.cards)

for i in range(5):
    x = d1.deal()
    print("x:", x)

print(d1.dealer)

for name in "Teddy", 5, ['a', 'b'], 'Joe':
    try:
        d1.dealer = name
    except TypeError as err:
        print(err)
    else:
        print(d1.dealer)

j1 = JokerDeck('Benny')

print(j1)
j1.shuffle()
print(j1.deal())
print(j1.cards)

e1 = EuchreDeck('Mitchell')

print(e1.cards)

print(len(d1), len(j1), len(e1))
Beispiel #16
0
hand = []

for i in range(5):
    hand.append(d1.draw())

for card in hand:
    print(card.rank, card.suit)
print()

print(d1.get_suits())
print(CardDeck.get_suits())

print(len(d1))
print(d1, '\n')

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

j1.bark()
print(JokerDeck.mro())
print()

d2 = CardDeck("Sue")

d3 = d1 + d2
print(d3)

print(d1 == d2)
Beispiel #17
0
d1.shuffle()

print(d1.cards)


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

print(d1.get_ranks())

print(CardDeck.get_ranks())

CardDeck.bark()

j1 = JokerDeck("Jimmy")

j1.shuffle()
print(j1.draw())

print(JokerDeck.mro())

print(j1.cards)

j1.spam()

print(len(d1))
# print(CardDeck.__len__(d1))
print(len(j1))

print(d1)
Beispiel #18
0
# normal (non-static) function
from module import Class, utilfunc

c = Class()
x = utilfunc(foo, bar)

# static function
from module import Class
c = Class
x = Class.utilfunc(foo, bar)



"""

j = JokerDeck('Eileen')
j.shuffle()
print(j)
print(j.dealer)
print(j.cards, '\n')
j.count()
print(JokerDeck.mro())

print(len(c), len(j))

print(c, j)
print(str(c), str(j))

print(repr(c))
print(repr(j))
print(d1.dealer_name)

try:
    d2.dealer_name = None
except TypeError as err:
    print(err)
print()

d1.shuffle()
print(d1.cards)
for i in range(5):
    print(d1.draw())

print(d1.get_ranks())
print(CardDeck.get_ranks())

d1.bark()
CardDeck.bark()
print()

j1 = JokerDeck("Shamu")
j1.shuffle()
print(j1.dealer_name)
print(j1.cards)
print(j1.get_instructions())

print(JokerDeck.mro())

print(len(j1))
print(d1, j1)
Beispiel #20
0
d1.shuffle()

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

print(d1.get_ranks())
print(CardDeck.get_ranks())

d1.beep()
d1.beep()

CardDeck.beep()
print('-' * 60)
j1 = JokerDeck('Albert')
j1.shuffle()

print(j1.draw())
print(j1.cards)

print(JokerDeck.mro())

print(d1.id)
print(j1.id)
j1.bark()

print(len(j1.cards))
# j1.cards.__len__()

print(len(j1))
Beispiel #21
0
for i in range(10):
    print(c1.draw())
print()

print(c1.get_ranks())
print()

print(CardDeck.get_ranks())
print()

c2 = CardDeck("Al")
c2.shuffle()
# CardDeck.shuffle(c2)

j1 = JokerDeck("Jim")
j1.shuffle()
for i in range(5):
    print(j1.draw())
print()
print(j1.cards)
print()
j1.shuffle()

print(len(c1), len(c2))
print(len(j1))

# print(CardDeck.__len__(j1))
print(c1)
print(str(c1))
print(c2)
d1.dealer = "Maria"
# CardDeck.dealer(d1, "Maria")
print(d1.dealer)

try:
    d1.dealer = 123.4
except TypeError as err:
    print(err)

print(dir(d1))

d1.shuffle()
print(d1.cards)

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

j1 = JokerDeck("Abby")
print(j1)
j1.shuffle()
print(j1.cards)

print(len(d1))
print(d1)
print(j1)

x = d1 + j1
print(x)
print(len(x))
d1.shuffle()
print(d1.cards)
print()

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

x = d1.draw()
x = CardDeck.draw(d1)

print(d1.get_suits())
CardDeck.get_suits()

j1 = JokerDeck("Jimmy")
j2 = JokerDeck("Jane")

print(j1)
j1.shuffle()
print(j1.draw())
print(j1.cards)
j1.play()

print(JokerDeck.mro())

print(d1._cards[0])  # NAUGHTY!!

print(len(d1._cards))  # NAUGHTY!!

print(len(d1.cards))  # semi-Naughty
Beispiel #24
0
try:
    d1.dealer = 1234
except Exception as err:
    print(err)
else:
    print(d1.dealer)

d1.dealer = "Kathy"

print(d1.dealer)

print(d1.get_suits())

print(CardDeck.get_suits())

j1 = JokerDeck('Bob')

j1.shuffle()

print(j1.cards)
j1.bark()

print(CardDeck.mro())
print(JokerDeck.mro())

j1.shout()

print(dir(j1))

funcs = [
    x for x in dir(j1) if callable(getattr(j1, x)) if not x.startswith('_')
Beispiel #25
0
hand = []
for i in range(5):
    hand.append(d.draw())

print("Hand:", hand)

print(str(d))
print(len(d.cards))

print(len(d))

d2 = CardDeck("Mary")

d3 = d + d2

print(d3)

j1 = JokerDeck('Albert')
j1.shuffle()

d4 = d + j1

print(d4)

print(j1.cards)

j1.barf()

print(JokerDeck.mro())
Beispiel #26
0
print(C1.dealer)

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)
Beispiel #27
0
d2.dealer = "Billy"

d1.shuffle()

print(d1.cards)

d2.shuffle()

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

print(d1.cards)

print(len(d1))
print(len(d2))

print(d1)
print(d2)

d1.spam()

print(d1.show_suits())
print(CardDeck.show_suits())
print('-' * 60)
j1 = JokerDeck("Jimmy")
j1.shuffle()
print(j1)
print(len(j1))
print(d1)
Beispiel #28
0
d1 = CardDeck('Bob')

print(d1.get_dealer())

print(d1.dealer)

d1.dealer = 'Lamont'

print(d1.dealer)

d1.shuffle()

print(d1.cards)

print(d1.get_suits())
print(CardDeck.get_suits())

print(d1)

print(len(d1))
d2 = CardDeck("Julius")

d3 = d1 + d2
print(d3, len(d3))
print()
j1 = JokerDeck("Albert")
j1.shuffle()
print(j1.cards)
j1.bark()
Beispiel #29
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)


Beispiel #30
0
    print(err)

d1.shuffle()

print(d1.cards)

hand = []
for _ in range(5):
    hand.append(d1.draw())
print("hand:", hand)

print(d1.get_suits())

print(CardDeck.get_suits(), '\n')

j1 = JokerDeck('Albert')
j1.shuffle()
print(j1.cards)

print(j1, d1)

print(len(d1), len(j1))

print(repr(d1))

print(dir(d1))

print(len(d1))
print(CardDeck.__len__(d1))

d2 = CardDeck('Mary')