X Tutup
Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Dice Rolling Simulator

This is a simple Python program that simulates rolling a 6-sided dice.

How to Use

  1. Clone or download the repository to your local machine.
  2. Ensure you have Python installed.
  3. Navigate to the directory where the script is located.
  4. Run the script using the command python dice_roller.py.
  5. Follow the on-screen instructions:
    • Choose option 1 to roll the dice.
    • Choose option 2 to exit the program.

Code Overview

The script consists of two main functions:

  1. roll_dice(): This function generates a random number between 1 and 6, simulating the roll of a dice, and prints the result.

  2. main(): This function presents a menu to the user with two options:

    • Option 1: Roll the dice.
    • Option 2: Exit the program.

    It then takes user input and calls the appropriate function based on the choice made.

Dependencies

This script requires Python to be installed on your system. It also uses the random module, which is a standard library in Python and does not require any additional installation.

Contribution

Contributions are welcome! If you find any bugs or have suggestions for improvement, please open an issue or create a pull request on the GitHub repository.

X Tutup