Advertisement
Guest User

Improved multi-sided die program. No GUI

a guest
Jun 21st, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. from random import randint
  2.  
  3. def roll():
  4.     for i in range(1, dq+1, 1):
  5.         x = randint (1,dx)
  6.         print(x)
  7.    
  8.     def playagain():
  9.  
  10.         def ufuckedup():
  11.             print("That answer makes no sense, idiot")
  12.             playagain()
  13.  
  14.         token = input("Roll Again? Y/N ")
  15.         if token == "y":
  16.             roll()
  17.         elif token == "n":
  18.             print("Bye!!!")    
  19.         else:
  20.             ufuckedup()
  21.            
  22.     playagain()
  23.        
  24. dq = int(input("How manyy die to roll? "))
  25. dx = int(input("How many sides? "))
  26. roll()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement