I am learning OOD in C++. Is there a good example of a dice game that can help teach me how to understand C++ and object oriented design? Concepts such as Using classes abstract data types including: using constructors and destructors, using pointers, using inheritance, providing for exception handling, and using recursive definitions? I myself would like to come up with a game that titled 'high roller' where a player could play a computer where each have 3 dice and the highest score wins. Pretty simple but I am still learning these concepts. Thank you,
I am learning OOD in C++. Is there a good example of a dice game that can help teach me how to understand C++ and object oriented design?
Concepts such as Using classes abstract data types including: using constructors and destructors, using pointers, using inheritance, providing for exception handling, and using recursive definitions?
I myself would like to come up with a game that titled 'high roller' where a player could play a computer where each have 3 dice and the highest score wins. Pretty simple but I am still learning these concepts.
Thank you,
The "High Roller" game is a simple dice game played between a human player and a computer. Each participant has three dice. The objective is to roll the dice and achieve a combined total that's higher than the opponent's. To enhance our understanding of C++ and Object-Oriented Design (OOD), the game incorporates various programming concepts, including classes, constructors/destructors, pointers, inheritance, exception handling, and recursive definitions.
Algorithm
- Initialize the game with a human player and a computer player. Both players have three dice.
- The human player rolls their three dice.
- The computer player rolls their three dice.
- Compare the total scores of the two players.
- Display the individual dice values and the outcome (Human wins, Computer wins, or Tie).
- Ask the user if they wish to play again.
- If yes, repeat steps 2-6. If no, end the game.
Step by step
Solved in 5 steps with 1 images