Develop an object-oriented Python Pig(dice game) using test-driven development process. The Pig(dice game) should be played by one player towards the computer and as a two player game. You application should be divided into classes where each class resides in its own file. Some suggestions of classes are Game, Dice, DiceHand, Histogram, Intelligence, HighScore, Player - Each player should be able to select a name for them self and a player should be able to change their name. - There should be a persistent high score list where statistics on each player and their played games, are stored and visible. The statistics should remain if the player changes their name. - One should be able to see the rules of the game. - One should be able to play a whole game round. One should be able to quit the current game and restart it. - There should be a cheat which one can use for testing purpose and reach the end of the game faster. This cheat should contain a information text some one knows how to use it. - The game should have a nice graphical representation so it looks like fun to play it. - When the computer is playing, it should have some type of intelligence(like: Beginner, Normal, Hard) for playing the game. There should be several settings for the level of intelligence for the computer playing. These should be configurable by the user while playing. - The game should be resilient and continue to work if/when the user enters bad input. - Try hard to make small enough methods. - Your code shall be covered by unit tests. The unit tests shall be stored in one file per class. Each class should have a complete set of unit tests. If there are modules and functions then these should also be covered by unit tests and these should be stored in their own files so it is obvious which unit tests belong to a certain class or module.
Develop an object-oriented Python Pig(dice game) using test-driven development process. The Pig(dice game) should be played by one player towards the computer and as a two player game.
You application should be divided into classes where each class resides in its own file. Some suggestions of classes are Game, Dice, DiceHand, Histogram, Intelligence, HighScore, Player
- Each player should be able to select a name for them self and a player should be able to change their name.
- There should be a persistent high score list where statistics on each player and their played games, are stored and visible. The statistics should remain if the player changes their name.
- One should be able to see the rules of the game.
- One should be able to play a whole game round. One should be able to quit the current game and restart it.
- There should be a cheat which one can use for testing purpose and reach the end of the game faster. This cheat should contain a information text some one knows how to use it.
- The game should have a nice graphical representation so it looks like fun to play it.
- When the computer is playing, it should have some type of intelligence(like: Beginner, Normal, Hard) for playing the game. There should be several settings for the level of intelligence for the computer playing. These should be configurable by the user while playing.
- The game should be resilient and continue to work if/when the user enters bad input.
- Try hard to make small enough methods.
- Your code shall be covered by unit tests. The unit tests shall be stored in one file per class. Each class should have a complete set of unit tests.
If there are modules and functions then these should also be covered by unit tests and these should be stored in their own files so it is obvious which unit tests belong to a certain class or module.
Step by step
Solved in 2 steps