Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DICE GAME PYTHON PROGRAMMING I want to make a dice game like this in python: Create a class that represents the game itself. The game

DICE GAME PYTHON PROGRAMMING

I want to make a dice game like this in python:

Create a class that represents the game itself. The game must have at least one dice and a list of players. Create a function that creates a player based on user input. The function should read the name from the user, throws the dice three times and sets the score equal to the sum of those three dice. The function should return a reference to the player object that was created. Create a method in the class for the game that plays a lap for one player. The method should take the player object to the player as a parameter. The method should: Show who their turn is by printing a message that includes the name of the player Print the score of the player Ask if the player will throw the dice again If the player wants it: roll the dice and add the value to the score Declare if the player has received more than 21 points and thus lost the game Create a script that tests that classes and methods work as far as they should Create a function that requests the number of players and reads it from the user. Then, should The feature creates the specified number of players and puts them in a list of players. The designer of the class of the game itself must take this list of players as a parameter. Create a method in the class for the game that plays a game for all players. That is, every player who has not lost or chosen to finish will still play a new game. You have to find out how the method should distinguish between players who are still involved and non-participating players. Create a method in the class for the game that checks who, if any, has won. For that mandatory part you just need to return one player, you do not have to handle the draw. Create a script that runs the game and plays rounds until someone wins

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

Step: 3

blur-text-image

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 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

More Books

Students also viewed these Databases questions

Question

What is human nature?

Answered: 1 week ago