How do I make my code print out the dice image according to the random dice it rolled? This is the code that I have so far whhich roll the dice according to what the user input and the value will be stored in the result list. how can i print the dice image according to the list? Any guidance or help will be appreciated.
import random
num_of_dice = int(input("Number of dice to roll: "))
def roll_dice(num_of_dice):
result = []
for i in range(num_of_dice):
roll = random.randint(1, 6)
result.append(roll)
die_art = {
1: ["┌─────────┐",
"│ │",
"│ ● │",
"│ │",
"└─────────┘"
],
2: ["┌─────────┐",
"│ ● │",
"│ │",
"│ ● │",
"└─────────┘"
],
3: ["┌─────────┐",
"│ ● │",
"│ ● │",
"│ ● │",
"└─────────┘"
],
4: ["┌─────────┐",
"│ ● ● │",
"│ │",
"│ ● ● │",
"└─────────┘"
],
5: ["┌─────────┐",
"│ ● ● │",
"│ ● │",
"│ ● ● │",
"└─────────┘"
],
6: ["┌─────────┐",
"│ ● ● │",
"│ ● ● │",
"│ ● ● │",
"└─────────┘"
]
}
roll_dice(num_of_dice)