A command-line dice game built with Python where players can play against the computer or another player.
The game uses random dice rolls, score tracking, multiple rounds, and simple turn-based gameplay.
- ๐ฎ Two Game Modes
- Player vs Computer
- Player vs Player
- ๐ฒ Random Dice Rolls (1โ6)
- ๐ Turn-Based Gameplay
- ๐ Score Comparison & Winner Announcement
- ๐ Rules Section
- ๐ก๏ธ Basic Input Handling
- ๐ฏ Multiple Round Support
- ๐ฅ๏ธ CLI (Command Line Interface)
- Python 3
- Functions
- Loops (
while,for) - Conditional Statements
- Exception Handling (
try-except) - User Input Handling
- Random Module
- Score Tracking Logic
Dice-Master-Game/
โโโ dice_game.py
โโโ README.md
- Enter player name.
- Choose number of rounds.
- Player and computer roll dice turn by turn.
- Scores are added after every roll.
- Highest total score wins.
- Enter names of both players.
- Choose number of rounds.
- Players roll dice alternately.
- Scores are calculated.
- Player with the highest score wins.
- Game is turn-based.
- Press Enter to roll the dice.
- Dice generates a random number from 1 to 6.
- Total score is calculated across rounds.
- Highest score wins the match.
python dice_game.py๐ฒ DICE MASTER ๐ฒ
1 - Play with computer
2 - Play with player
3 - Show rules
Enter Your Choice : 1
Enter player name : Amar
Enter number of rounds : 3
Amar got - 5 ๐ฒ
Computer got - 2 ๐ฒ
--- Amar wins ---๐
โ Two playable game modes
โ Uses Python's random module for dice generation
โ Turn-based gameplay system
โ Supports multiple rounds
โ Handles invalid inputs with default values
Amarnath Rastogi