This commit is contained in:
Adam 2022-12-26 16:37:04 -05:00
parent 53e80090d9
commit 947a371fc4
2 changed files with 9 additions and 4 deletions

View file

@ -15,13 +15,13 @@ class Deck:
n_decks = 8 if n_decks > 8 else n_decks n_decks = 8 if n_decks > 8 else n_decks
suits = '♠♥♦♣' suits = '♠♥♦♣'
cards = 'A234567890JQK' cards = 'A234567890JQK'
# cards = 'A0A0A0A0A0A0A'
while n_decks > 0: while n_decks > 0:
self.cards += [card + suit for card in cards for suit in suits] self.cards += [card + suit for card in cards for suit in suits]
n_decks -= 1 n_decks -= 1
def check(self): def check(self):
if self.count() < 4: if self.count() < 1:
self.shuffle(self.n_decks) self.shuffle(self.n_decks)
def draw(self): def draw(self):

View file

@ -11,6 +11,7 @@ o8YooP' 8 .oPYo. .oPYo. 8 .o 8 .oPYo. .oPYo. 8 .o
:......:..:.....::.....:..::......::.....::.....:..::... :......:..:.....::.....:..::......::.....::.....:..::...
:::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::''' ::::::::::::::::::::::::::::::::::::::::::::::::::::::::'''
self.clear = '\033c' self.clear = '\033c'
self.intro = self.clear + self.title self.intro = self.clear + self.title
self.deck = '''\ self.deck = '''\
@ -21,6 +22,7 @@ o8YooP' 8 .oPYo. .oPYo. 8 .o 8 .oPYo. .oPYo. 8 .o
''' '''
self.hidden_part = f'''\ self.hidden_part = f'''\
@ -29,6 +31,7 @@ o8YooP' 8 .oPYo. .oPYo. 8 .o 8 .oPYo. .oPYo. 8 .o
''' '''
self.hidden_rest = f'''\ self.hidden_rest = f'''\
@ -37,6 +40,7 @@ o8YooP' 8 .oPYo. .oPYo. 8 .o 8 .oPYo. .oPYo. 8 .o
''' '''
self.card_rest = f'''\ self.card_rest = f'''\
@ -50,6 +54,7 @@ o8YooP' 8 .oPYo. .oPYo. 8 .o 8 .oPYo. .oPYo. 8 .o
value = vs[0] value = vs[0]
value = '10' if value == '0' else value + ' ' value = '10' if value == '0' else value + ' '
suit = vs[1] + ' ' suit = vs[1] + ' '
# request text (not emoji) render of preceeding glyph but can break some fonts # request text (not emoji) render of preceeding glyph but can break some fonts
# suit += '\uFE0E' # suit += '\uFE0E'
@ -94,6 +99,6 @@ o8YooP' 8 .oPYo. .oPYo. 8 .o 8 .oPYo. .oPYo. 8 .o
print(self.clear) print(self.clear)
print(self.title) print(self.title)
for player in game.players: for player in game.players:
print(' '+player.name, print(' '+player.name,'''\
'\t\t\t\t Score:',player.score(game)) Score:''', player.score(game))
self.print_hand(player, game) self.print_hand(player, game)