Inspiration
I wanted to create a simple game that is familiar to many people in C++ and Yahtzee has been one of my all time favorites.
What it does
This program simulates a full game of Yahtzee with a text-based interface. Players can roll dice, choose categories, and keep track of their score. It mimics the core mechanics of the real game, including rerolling dice and scoring based on various combinations.
How I built it
I used C++ classes to represent the main game components: Dice, Hand, and Game. Each class handles its respective part of the game, like rolling dice, tracking selected dice, and calculating scores.
Challenges I ran into
Debugging the code to ensure everything worked as expected was tricky, especially managing access control in the classes. Keeping the logic error-free while handling multiple dice rolls and score combinations took some time to get right.
Accomplishments that I'm proud of
I’m proud that the game now runs without errors and functions exactly as I intended. Seeing the complete game work as planned was very satisfying.
What I learned
I deepened my understanding of C++ classes and object-oriented programming through this project. Managing interactions between different classes and game states was a valuable learning experience.
What's next for Yahtzee
I plan to add an AI opponent to make the game more challenging, allowing players to compete against the computer for the highest score.
Log in or sign up for Devpost to join the conversation.