Advertisement
PIBogdanov

dice

Feb 18th, 2023
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.15 KB | None | 0 0
  1. import os
  2. import random
  3.  
  4.  
  5. x = "y"
  6.  
  7. while x == "y":
  8.      
  9.     # Generates a random number
  10.     # between 1 and 6 (including
  11.     # both 1 and 6)
  12.     no = random.randint(1,6)
  13.      
  14.     if no == 1:
  15.         print("[-----]")
  16.         print("[     ]")
  17.         print("[  0  ]")
  18.         print("[     ]")
  19.         print("[-----]")
  20.     if no == 2:
  21.         print("[-----]")
  22.         print("[ 0   ]")
  23.         print("[     ]")
  24.         print("[   0 ]")
  25.         print("[-----]")
  26.     if no == 3:
  27.         print("[-----]")
  28.         print("[     ]")
  29.         print("[0 0 0]")
  30.         print("[     ]")
  31.         print("[-----]")
  32.     if no == 4:
  33.         print("[-----]")
  34.         print("[0   0]")
  35.         print("[     ]")
  36.         print("[0   0]")
  37.         print("[-----]")
  38.     if no == 5:
  39.         print("[-----]")
  40.         print("[0   0]")
  41.         print("[  0  ]")
  42.         print("[0   0]")
  43.         print("[-----]")
  44.     if no == 6:
  45.         print("[-----]")
  46.         print("[0 0 0]")
  47.         print("[     ]")
  48.         print("[0 0 0]")
  49.         print("[-----]")
  50.          
  51.     x=input("press y to roll again and n to exit:")
  52.     print("\n")
  53.     os.system('cls')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement