Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Try It several times in a row to see the different dice rolls. Then, uncomment the line that says random.seed ( 1 2 3 4

Try It several times in a row to see the different dice rolls.
Then, uncomment the line that says random.seed(1234)
and run it several times. What happened? Try experimenting with different values for the random.seed function and run several times to see what happens.
Setting the random seed to a fixed value allows you to get predictable results every time, but it does not allow for a very interesting dice game. Comment the line back out so you have a random roll of the dice again.
Try modifying your code to use 4,8,12, or 20 sided dice.
Then, modify your code to ask the user how many sides their two dice have. Even though you couldnt build fair 7 or 13 sided dice physically, with digital dice you could use them.
You need to ask for how many sides each dice has. This means two inputs for two dice!
TRY IT
Once you are confident your dice game is working properly, check it for a grade. Before you check it, you have to remember to uncomment the line that sets the random seed so that the autograder will know which rolls should come up.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2016 Riva Del Garda Italy September 19 23 2016 Proceedings Part 3 Lnai 9853

Authors: Bettina Berendt ,Bjorn Bringmann ,Elisa Fromont ,Gemma Garriga ,Pauli Miettinen ,Nikolaj Tatti ,Volker Tresp

1st Edition

3319461303, 978-3319461304

More Books

Students also viewed these Databases questions

Question

The chemical formula 21 [Ca(OH)2] + x2[H NO3]

Answered: 1 week ago

Question

5. Identify three characteristics of the dialectical approach.

Answered: 1 week ago

Question

7. Identify six intercultural communication dialectics.

Answered: 1 week ago