Advertisement
PIBogdanov

Dice Game

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