Dice Roll Game is a simple console application written in C#. In this game, players are given three attempts to guess the number on a virtual dice, ranging from 1 to 6.
- The player is prompted to guess a number between 1 and 6.
- If the player's guess is correct, they win immediately.
- If the guess is incorrect, the number of tries is decremented.
- The game ends either when the player guesses correctly or exhausts their three attempts.
- .NET SDK (Compatible with .NET Core 3.1 or later)
To run the game, follow these steps:
- Ensure that .NET SDK is installed on your system.
- Clone this repository or download the source code.
- Navigate to the directory containing the game's code.
- Run the command
dotnet run
in your terminal or command prompt.
The game logic is encapsulated in the DiceRollGame
class, which generates a random number between 1 and 6 (inclusive). This number represents the dice's face value. The IsRightGuess
method checks if the player's guess matches this value.
Contributions are welcome. Please feel free to fork the repository, make changes, and submit a pull request.