Guest User

Untitled

a guest
Jul 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import random
  2. import sys
  3. import os
  4.  
  5. print("""Dice Roller by GomiHiko
  6. Please input the amount of dice you would like to roll.""")
  7. diceAmount = int(input('Number of Dice: '))
  8. print('You have selected ' + str(diceAmount) + ' dice.')
  9. print('Rolling ' + str(diceAmount) + ' dice...')
  10.  
  11. diceRolled = 0
  12. diceResults = 0
  13.  
  14. while diceRolled < diceAmount:
  15. diceRolled += 1
  16. diceInitResult = (random.randint(1, 6))
  17. print(diceInitResult)
  18.  
  19. if diceRolled == diceAmount:
  20. print('Dice roll completed. Would you like to roll again?')
  21. choice = input('y/n: ')
  22. if (choice == 'y' or choice == 'yes'):
  23. os.execl(sys.executable, sys.executable, *sys.argv)
  24. else:
  25. sys.exit()
Add Comment
Please, Sign In to add comment