Skip to content

devprajwalgotnochill/dice-game-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🎲 Beat the Computer - Dice Game

A simple Python command-line dice game where you compete against the computer. You roll a set number of dice, and whoever has the higher total wins!


πŸ“Œ Features

  • Roll as many dice as you choose.
  • Each dice roll is displayed with Unicode dice faces βš€ ⚁ βš‚ βšƒ βš„ βš….
  • The computer rolls the same number of dice.
  • The winner is decided based on the total points.

πŸš€ How to Play

  1. Run the script in a terminal:
    python dice_game.py
  2. Enter the number of dice you want to roll when prompted.
    BEAT THE COMPUTER 
    ENTER HOW MANY DICE YOU WANT TO ROLL : 3
    
  3. Watch your dice rolls and compare with the computer’s.

Example output:

⚁
βš„
βšƒ
You won! Your points 12, computer points 10

πŸ›  Code Structure

  • roll_dice() β†’ Handles the player’s dice rolls and displays them.
  • computer_roll() β†’ Handles the computer’s dice rolls (hidden).
  • check_win() β†’ Compares totals and declares the winner.

πŸ“‚ File Structure

dice_game/
│── dice_game.py   # Main game script
│── README.md      # Project description

βœ… Requirements

  • Python 3.x
  • No external libraries (only built-in random)

🎯 Future Improvements

  • Add multiple rounds (best of 3, best of 5).
  • Display computer’s dice faces.
  • Add score history tracking.
  • Option to play again without restarting.

About

dice-game-python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages