Advertisement
PIBogdanov

dice

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