Question: Please find the starter code here: https://repl.it/@bus101/Starter-code-Project-3 Copy the code into your own account. Make sure that you dont change any of the provided code.
Please find the starter code here: https://repl.it/@bus101/Starter-code-Project-3 Copy the code into your own account. Make sure that you dont change any of the provided code.
You will need random to generate random numbers (e.g., the die roll).
What you need to create
Function: get_roll(rollstring)
This function takes an input parameter as a string that looks like 1d3, 3d5, etc. The function should return an integer simulating those dice rolls. In the case of 3d5, for example, the function will generate a random number between one and five, three times, and return the total (sum) as an integer. This function should return the value back to get_damage().
Function: get_damage(attack, defense)
This function gets the value of damage based on roll strings. Player 1 (the first roll) is always on attack; Player 2 (the second roll) is always on defense. If the defense roll is greater than the attack roll, return 0. Otherwise, return attack minus defense, as an integer. This function should call get_roll() twice, once for each Player. This function should return the value back to main_main().
Function: main_menu()
In this function, ask the user how many rounds they want to play. Next, ask the user to input Player 1 and Player 2s dice for roll one, roll two, etc., up to the number of rolls they entered. The rolls for each round must be entered on one line with no spaces. This function should call get_damage() for each round.
Finally, display each Players roll and the damage from that round.
This function does not need to return anything.
Assumptions and clarifications
You can assume that for each round, the user will always enter two valid roll strings, separated by a comma, all on one line. Positive whole numbers will be used.
A roll can contain a very large number of dice (more than is possible in real life) and each die can have a very large number of sides (again, more than is possible in real life).
You are not allowed to call get_roll() directly from main_menu().

Sample output Each group of output is from a separate run of the program. The program only needs to run once each time. Remember that dice rolls (in real life and in this program) are random so your output probably won't match mine, and you may not get the same output each time for the same rolls. How many rounds do you want to play? 3 Input Player 1 and Player 2's rolls for round 1: 103,103 Input Player 1 and Player 2's rolls for round 2: 106,103 Input Player 1 and Player 2's rolls for round 3: 106,1010 Player 1 Attack: 1d3, Player 2 Defense: 1d3 >> Damage: 1 Player 1 Attack: 106, Player 2 Defense: 103 >> Damage: 3 Player 1 Attack: 106, Player 2 Defense: 1d10 >> Damage: 0 How many rounds do you want to play? 2 Input Player 1 and Player 2's rolls for round 1: 10005,150d3 Input Player 1 and Player 2's rolls for round 2: 99d6,10007 Player 1 Attack: 100d5, Player 2 Defense: 15003 >> Damage: 6 Player 1 Attack: 99d6, Player 2 Defense: 10007 >> Damage: 0 How many rounds do you want to play? 5 Input Player 1 and Player 2's rolls for round 1: 500d5,500d5 Input Player 1 and Player 2's rolls for round 2: 600d6,600d6 Input Player 1 and Player 2's rolls for round 3: 123d456,123d123 Input Player 1 and Player 2's rolls for round 4: 1010000000, 101000000000000 Input Player 1 and Player 2's rolls for round 5: 1d1,1d1 Player 1 Attack: 500d5, Player 2 Defense: 500d5 >> Damage: 0 Player 1 Attack: 60006, Player 2 Defense: 600d6 >> Damage: 0 Player 1 Attack: 123d456, Player 2 Defense: 123d123 >> Damage: 20716 Player 1 Attack: 1010000000, Player 2 Defense: 1d1000000000000 >> Damage: 0 Player 1 Attack: 1di, Player 2 Defense: 1dl >> Damage: 0 Sample output Each group of output is from a separate run of the program. The program only needs to run once each time. Remember that dice rolls (in real life and in this program) are random so your output probably won't match mine, and you may not get the same output each time for the same rolls. How many rounds do you want to play? 3 Input Player 1 and Player 2's rolls for round 1: 103,103 Input Player 1 and Player 2's rolls for round 2: 106,103 Input Player 1 and Player 2's rolls for round 3: 106,1010 Player 1 Attack: 1d3, Player 2 Defense: 1d3 >> Damage: 1 Player 1 Attack: 106, Player 2 Defense: 103 >> Damage: 3 Player 1 Attack: 106, Player 2 Defense: 1d10 >> Damage: 0 How many rounds do you want to play? 2 Input Player 1 and Player 2's rolls for round 1: 10005,150d3 Input Player 1 and Player 2's rolls for round 2: 99d6,10007 Player 1 Attack: 100d5, Player 2 Defense: 15003 >> Damage: 6 Player 1 Attack: 99d6, Player 2 Defense: 10007 >> Damage: 0 How many rounds do you want to play? 5 Input Player 1 and Player 2's rolls for round 1: 500d5,500d5 Input Player 1 and Player 2's rolls for round 2: 600d6,600d6 Input Player 1 and Player 2's rolls for round 3: 123d456,123d123 Input Player 1 and Player 2's rolls for round 4: 1010000000, 101000000000000 Input Player 1 and Player 2's rolls for round 5: 1d1,1d1 Player 1 Attack: 500d5, Player 2 Defense: 500d5 >> Damage: 0 Player 1 Attack: 60006, Player 2 Defense: 600d6 >> Damage: 0 Player 1 Attack: 123d456, Player 2 Defense: 123d123 >> Damage: 20716 Player 1 Attack: 1010000000, Player 2 Defense: 1d1000000000000 >> Damage: 0 Player 1 Attack: 1di, Player 2 Defense: 1dl >> Damage: 0