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!
- 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.
- Run the script in a terminal:
python dice_game.py
- Enter the number of dice you want to roll when prompted.
BEAT THE COMPUTER ENTER HOW MANY DICE YOU WANT TO ROLL : 3 - Watch your dice rolls and compare with the computerβs.
Example output:
β
β
β
You won! Your points 12, computer points 10
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.
dice_game/
βββ dice_game.py # Main game script
βββ README.md # Project description
- Python 3.x
- No external libraries (only built-in
random)
- Add multiple rounds (best of 3, best of 5).
- Display computerβs dice faces.
- Add score history tracking.
- Option to play again without restarting.