Advertisement
pacho_the_python

Untitled

Feb 2nd, 2022
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.25 KB | None | 0 0
  1. import random
  2.  
  3. difficulty = input("Choose between Easy, Hard, Inhuman or Custom: ")
  4.  
  5. n = 0
  6. k = 0
  7. if difficulty == "Easy":
  8.     n = 10
  9. elif difficulty == "Hard":
  10.     n = 25
  11. elif difficulty == "Inhuman":
  12.     n = 50
  13. elif difficulty == "Custom":
  14.     n = int(input("Enter first number: "))
  15.     k = int(input("Enter second number "))
  16. bomb = "*"
  17. empty = "-"
  18. combinations = bomb + empty
  19. board = ""
  20.  
  21. for i in range(n):
  22.     if difficulty == "Easy":
  23.         board = " ".join(random.choices(combinations, weights=[15, 50], k=n))
  24.  
  25.     elif difficulty == "Hard":
  26.         board = " ".join(random.choices(combinations, weights=[25, 50], k=n))
  27.  
  28.     elif difficulty == "Inhuman":
  29.         board = " ".join(random.choices(combinations, weights=[50, 50], k=n))
  30.  
  31.     elif difficulty == "Custom":
  32.         board = " ".join(random.choices(combinations, weights=[35, 50], k=k))
  33.     print(board)
  34.  
  35. print()
  36.  
  37. # player_board
  38.  
  39. if difficulty == "Easy" or difficulty == "Hard" or difficulty == "Inhuman":
  40.     for i in range(n):
  41.         for j in range(n):
  42.             print("^ ", end="")
  43.         print()
  44. elif difficulty == "Custom":
  45.     for i in range(n):
  46.         for j in range(k):
  47.             print("^ ", end="")
  48.         print()
  49.  
  50. number_of_guesses = 10
  51. lives = 3
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement