Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import sys
- import os
- print("""Dice Roller by GomiHiko
- Please input the amount of dice you would like to roll.""")
- diceAmount = int(input('Number of Dice: '))
- print('You have selected ' + str(diceAmount) + ' dice.')
- print('Rolling ' + str(diceAmount) + ' dice...')
- diceRolled = 0
- diceResults = 0
- while diceRolled < diceAmount:
- diceRolled += 1
- diceInitResult = (random.randint(1, 6))
- print(diceInitResult)
- if diceRolled == diceAmount:
- print('Dice roll completed. Would you like to roll again?')
- choice = input('y/n: ')
- if (choice == 'y' or choice == 'yes'):
- os.execl(sys.executable, sys.executable, *sys.argv)
- else:
- sys.exit()
Add Comment
Please, Sign In to add comment