Question: Use Python Phase 1: Simulator In the first phase, you will develop a simulator for the game of Hog. Problem 1 (1 pt). Implement the
Use Python
Phase 1: Simulator In the first phase, you will develop a simulator for the game of Hog. Problem 1 (1 pt). Implement the roll_dice function in hog.py, which returns the number of points scored by rolling a fixed positive number of dice: either the sum of the dice or 1. To obtain a single outcome of a dice roll, call dice(). You should call this function exactly num_rolls times in your implementation. The only rule you need to consider for this problem is Pig out. As you work, you can add print statements to see what is happening in your program. Remove them when you are finished. Test your implementation before moving on: python3 hog_grader.py - 1 You can also run an interactive test, which allows you to type in the dice outcome, which is helpful for catching cases that are not handled in hog_grader.py : python3 hog.py -i roll_dice
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
