I made a simple blackjack game using python. I made the rest of the game but i am struggling to put in the ascii cards, so this is just a fraction of the code. I have tried putting * len(phand) at the end of the append lines. While this does give me multiple cards side by side, it doesn't seem to let me edit them.
#Phand is the hand you draw so it could be any combination of cards
phand = ["2 of Hearts", "King of Diamonds", "Ace of Clubs"]
print(phand)
for xx in range(0, len(phand)):
pcarddisplay = []
pcarddisplay.append("┌─────────┐")
pcarddisplay.append("│{}{}. . .│")
pcarddisplay.append("│. . . . .│")
pcarddisplay.append("│. . . . .│")
pcarddisplay.append("│. . {}. .│")
pcarddisplay.append("│. . . . .│")
pcarddisplay.append("│. . . . .│")
pcarddisplay.append("│. . .{}{}│")
pcarddisplay.append("└─────────┘")
x = ("│.", phand[xx][:1], ". . . .│")
pcarddisplay[1] = "".join(x)
x = ("│. . . .", phand[xx][:1], ".│")
pcarddisplay[7] = "".join(x)
if "Diamonds" in phand[xx]:
pcarddisplay[4] = "│. . ♦ . .│"
if "Clubs" in phand[xx]:
pcarddisplay[4] = "│. . ♣ . .│"
if "Hearts" in phand[xx]:
pcarddisplay[4] = "│. . ♥ . .│"
if "Spades" in phand[xx]:
pcarddisplay[4] = "│. . ♠ . .│"
print("\n".join(pcarddisplay))
This outputs:
['2 of Hearts', 'King of Diamonds', 'Ace of Clubs']
┌─────────┐
│.2. . . .│
│. . . . .│
│. . . . .│
│. . ♥ . .│
│. . . . .│
│. . . . .│
│. . . .2.│
└─────────┘
┌─────────┐
│.K. . . .│
│. . . . .│
│. . . . .│
│. . ♦ . .│
│. . . . .│
│. . . . .│
│. . . .K.│
└─────────┘
┌─────────┐
│.A. . . .│
│. . . . .│
│. . . . .│
│. . ♣ . .│
│. . . . .│
│. . . . .│
│. . . .A.│
└─────────┘
How could I go about making these print out side by side?