⚀ Python Dice Rolling Game

A minimal CLI dice simulator — zero dependencies, pure Python

Python 3 CLI MIT License

Live demo

Click the button to roll two virtual dice — exactly like the Python game.

-
-
Click to roll

Quick start

No dependencies, no virtual environment, no build step. Works with any Python 3.

# Clone the repo
git clone git@github.com:Chenboda01/Python-Dice-Rolling-Game.git
cd Python-Dice-Rolling-Game

# Run the game
python3 dice-game.py

Usage

The game prompts you on each turn:

Roll the dice? (y/n): y
(42, 17)
Roll the dice? (y/n): y
(5, 33)
Roll the dice? (y/n): n
Thanks for playing!

Dice behavior

Source code

The entire game is a single 13-line Python script — no external packages, no config files.

import random

while True:
  choice = input('Roll the dice? (y/n): ').lower()
  if choice == 'y':
      die1 = random.randint(1, 50)
      die2 = random.randint(1, 50)
      print(f'({die1}, {die2})')
  elif choice == 'n':
      print('Thanks for playing!')
      break
  else:
      print('Invalid choice!')