- Description
- Installing and Running
- How to Use
- License
- How to Contribute
- Additional Points
- Conclusion
This Python script generates and displays a random dice roll for one or two dice.
- Download or clone the repository.
- Check that Python3 is installed.
- Launch the terminal or command prompt and navigate to the directory containing the script.
- Run the script in the terminal by typing python3 dice_roll.py..
- When prompted, enter the number of dice you want to throw. The only valid answers are "1" or "2."
- If you roll two dice, both the individual die values and the sum will be shown.
- You will be asked to roll once again once the results are displayed. Enter "yes" or "y," or any other key to depart, to roll once again.
MIT License applies.
Contributions are not presently required for this code, although they are much welcomed. You may clone the repository and make your own changes if you want to. If you want to share your improvements with the community, submit a pull request.
To make the output simpler to read, the script clears the terminal screen after each roll. The script will alert the user to supply a valid input if an invalid one is given for the number of dice to be rolled. Just six-sided dice are used in the script.
This is a simple Python script for producing random dice rolls for use in games or other tasks. Feel free to change and improve it as required.