# -*- coding: utf-8 -*- """ Created on Tue Jun 29 17:11:03 2021 @author: Daniel Mishler """ # Practice problem 1: # properly import the "utils.py" library. You can do it however you want. # Run this code and make sure that "utils loaded successfully" prints. # Note: you are absolutely allowed to change things in the utils.py file, # But (like any professional coding environment), you should ensure that # any code you write will still run and work with the default utils.py! # Practice problem 2: # (this one is review for for loops) # What is the average result of a D20 rolled with advantage? # Write whatever code you need to determine this answer below. # Answer in a comment here: """ This many times """ # No, googling the answer is not good enough # (but you can use that to check your work!) # Practice problem 3: # Go ahead and download and run that "Utils testing" file and fiddle # around for a bit. # How many zombies are needed so that they have a 1% chance to win? # How many zombies are needed so that they have a 66% chance to win? # How many zombies are needed so that they have a 99% chance to win? # There's another file I made on the website called "fightSimulation.txt" # That file is the result of a huge number of fights from the demo code! # How many times did the troll win total? """ ? """ # What was his victory percentage? """ ? """ # How many zombies did I have fighting the troll? """ ? """ # Yes, you'll probably need to write some file parsing here. # Practice problem 4: # Write a function called "monsterFromFile" # That takes the name of a file as an argument. # This function will find out the monster's armor class, attack bonus, # damage dice, damage bonus, and even name. It will return a monster # With all of this information properly allocated. This way you can # define monsters much more easily! You just have to say something like # skeleton = monsterFromFile('skeleton.monster') # And that's all you need! So much simpler. # Once you've written the function, finish it out by downloading # the acolyte and skeleton files from the website # Practice problem 5: # Copy the "fightManyRoll" function from utils.py here. # Change the name to "fightManyRollPrint" # At the end of each fight, this function will append to a file # (call the file whatever you want) the following information: # - A fight has just occurred # - The winner # - how many monsters fought on each side # - The names of all the monsters involved # - The total remaining current HP of the winning side # Now, have one skeleton fight two acolytes # a couple times in this new function.