<jupyter_start><jupyter_text>Pig, Advanced GameThe Rules for the Advanced version:  Players take turns rolling two standard, six-sided dice as follows: 1. During their turn, a player may roll the dice as many times as they want, keeping a running total of the sums that come up as long as no 1s are rolled. When the player stops rolling, they record the total and add it to the running score from previous turns **as long as** they have not rolled any 1s.2. If a 1 is rolled on just one of the dice before the player decides to stop rolling, then the player gets 0 points for that turn and it's the next player's turn.3. If a 1 is rolled on both dice, the turn ends and their running total score is set to 0. --- Once again, we will start with our import statments and a helper function to roll two dice. This time, I want to make my sum return the actual sum only if no ones are rolled. I can return zero if a one is rolled as this is the score for the turn and can easily be separated. I need to return something different for (1,1) however that I can easily separate in the turn function from both zero and the sums for the other numbers. One option for this is a negative number.Remember to check your function using Counter over many trials.<jupyter_code>import random
from collections import Counter
# write two_dice roll code here, if a single 1, return a zero, if 2 1s return a negative number have your function take a name
# Have your function tell what each die roll is and say something about any 1's
# test your function here 10000 times into a list and Counter. Your Counter results will be below prints. Scroll to bottom.<jupyter_output><empty_output><jupyter_text>Does the dice roll function look good?. I would expect $\frac{10}{36}$ rolls to have a single 1 and $\frac{1}{36}$ to be (1,1). 8 will be more common than 7 as a roll once (1,6) and (6,1) have been removed. Now we are ready to write our computer turn simulator. Remember that we have three main strategy types that we can write and that an extension idea will be to write all of them.  Start with one on your first write.    The three common strategies:* Roll up to a specific value and then stop.* Roll a certain number of times and then stop.* Roll until your total will beat your opponents’ and then stop.<jupyter_code># Choose a strategy and write computer turn code here. Be sure to give lost of info to the player.
# test your computer strategy here.<jupyter_output><empty_output><jupyter_text>Once we have one computer turn written and tested we can write the player turn.<jupyter_code># write your human player turn code here - this should take a name
# test your human player code here<jupyter_output><empty_output><jupyter_text>Now we need to assemble the game. As with the brginner game, it's a good idea to make the points to play to default to 100, but be an argument that you can set. After each turn, it should report the current scores. We may need to go back and make the computer turns stop rolling if the computer wins the game. This may require passing more arguments to those functions. Then, the simulated turn will need to take the current score as an argument.<jupyter_code># Write your game simulation here using your helper functions
# test your game here<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.04284412032816773, 'fraction_numerical': 0.011850501367365542, 'mean_word_length': 4.309677419354839, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '609130', 'license': 'MIT', 'n_tokens_mistral': 846, 'n_tokens_neox': 804, 'n_words': 565, 'path': 'Adv 02 Pig, Advanced Game Worksheet.ipynb', 'repo_name': 'AlberniSecondary/Middle-School-Python', 'size': '3291'}