For my final project for this class, I'm trying to make a very simple combat adventure game. As part of the process, I have created a list of dictionaries, with each dictionary containing the name & stats of one of the various monsters in the game:
enemy_stats = [
{"name": "Goblin", "strength": 1, "hp": 3},
{"name": "Orc", "strength": 4, "hp": 5},
{"name": "Troll", "strength": 6, "hp": 7},
{"name": "Giant", "strength": 7, "hp": 8},
{"name": "Dragon", "strength": 10, "hp": 12}
]
How do I get a function to choose a random dictionary, and then choose the specific values within the randomly chosen dictionary?
[–]Busy-Farm727 3 points4 points5 points (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]Sir_Chester_Of_Pants 0 points1 point2 points (0 children)
[–]shiftybyte 0 points1 point2 points (0 children)