Extend Exercise 8.11.
Extend the program from Exercise 8.11 such that the computer and the player can use a different number of dice. Let the computer choose a random number of dice between 2 and 20. Experiment to find out if there is a favorable number of dice for the player. Name of program file: simulate_strategies3.py.
Exercise 8.11
Solve Exercise 8.10 with different no. of dice.
Solve Exercise 8.10 for two other cases with 3 and 50 dice, respectively. Name of program file: simulate_strategies2.py.
Exercise 8.10
Compare two playing strategies.
Suggest a player strategy for the game in Chapter 8.4.2. Remove the question in the player_guess function in the file src/random/ndice2.py, and implement the chosen strategy instead. Let the program play a large number of games, and record the number of times the computer wins. Which strategy is best in the long run: the computer’s or yours? Name of program file: simulate_strategies1.py.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here