-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMounty.py
31 lines (26 loc) · 944 Bytes
/
Mounty.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import random
import matplotlib.pyplot as plt
def shuffle():
arr = ['goat', 'goat', 'car']
random.shuffle(arr)
initialization(arr)
def initialization(arr):
firstChoice = int(input("Kaçıncı kapını seçiyorsun[3 kapı var]: "))
if (firstChoice < 1) or (firstChoice > 3):
print("Böyle kapımız yok, ne yazık ki ))");
initialization()
start(firstChoice, arr)
def start(firstChoice, arr):
firstChoice = firstChoice - 1
is_True = True
for i in range(len(arr)):
if i == firstChoice:
continue
else:
if arr[i] == 'goat' and is_True:
print(str(i+1) + "-ci kapı açıldı => " + arr[i] + "\n\n" + "Sizin seçdiyiniz qapı: " + str(firstChoice + 1))
openDoor = i;
nextChoice = input("Seçiminizi değiştirmek istermisiniz ? E/H: ")
print(arr)
is_True = False
shuffle()