MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / displayCards

Function displayCards

barebones/blackjack-barebones.py:107–120  ·  view source on GitHub ↗
(allCards)

Source from the content-addressed store, hash-verified

105
106
107def displayCards(allCards):
108 rows = ['', '', '', '', ''] # The text to display on each row.
109
110 for card in allCards:
111 rank = card[0]
112 suit = card[1]
113 rows[0] += ' ___ ' # Print the top line of the card.
114 rows[1] += '|{} | '.format(rank.ljust(2))
115 rows[2] += '| {} | '.format(suit)
116 rows[3] += '|_{}| '.format(rank.rjust(2, '_'))
117
118 # Print each row on the screen:
119 for row in rows:
120 print(row)
121
122
123# Call the main() function to play the game:

Callers 1

displayHandsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected