Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🎲 Dice Master Game (Python)

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.


🚀 Features

  • 🎮 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)

🛠️ Technologies & Concepts Used

  • Python 3
  • Functions
  • Loops (while, for)
  • Conditional Statements
  • Exception Handling (try-except)
  • User Input Handling
  • Random Module
  • Score Tracking Logic

📂 Project Structure

Dice-Master-Game/
│── dice_game.py
│── README.md

⚙️ How The Game Works

Mode 1 — Player vs Computer

  1. Enter player name.
  2. Choose number of rounds.
  3. Player and computer roll dice turn by turn.
  4. Scores are added after every roll.
  5. Highest total score wins.

Mode 2 — Player vs Player

  1. Enter names of both players.
  2. Choose number of rounds.
  3. Players roll dice alternately.
  4. Scores are calculated.
  5. Player with the highest score wins.

🎯 Game Rules

  • 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.

▶️ Run The Program

python dice_game.py

💻 Example Output

🎲 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 ---🏆

📌 Key Highlights

✔ 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


👨‍💻 Author

Amarnath Rastogi

About

A simple and interactive dice game built with Python featuring Player vs Computer and Player vs Player modes.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages