Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- difficulty = input("Choose between Easy, Hard, Inhuman or Custom: ")
- n = 0
- k = 0
- if difficulty == "Easy":
- n = 10
- elif difficulty == "Hard":
- n = 25
- elif difficulty == "Inhuman":
- n = 50
- elif difficulty == "Custom":
- n = int(input("Enter first number: "))
- k = int(input("Enter second number "))
- bomb = "*"
- empty = "-"
- combinations = bomb + empty
- length = n
- board = ""
- for i in range(n):
- if difficulty == "Easy":
- board = " ".join(random.choices(combinations, weights=[15, 50], k=length))
- elif difficulty == "Hard":
- board = " ".join(random.choices(combinations, weights=[25, 50], k=length))
- elif difficulty == "Inhuman":
- board = " ".join(random.choices(combinations, weights=[50, 50], k=length))
- elif difficulty == "Custom":
- board = " ".join(random.choices(combinations, weights=[35, 50], k=k))
- print(board)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement