-
Notifications
You must be signed in to change notification settings - Fork 0
/
rus_rulet.py
59 lines (49 loc) · 1.98 KB
/
rus_rulet.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
print("""
#######################################################
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# PYHTON v.3.7.2 #
# Yazan: Mustafa #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#######################################################
""")
print("""Rus ruleti oyununa hosgeldiniz!\n
Oyunda sirayla toplam 6 adet atis yapilacaktir!
Silahin 6 mermi haznesi vardir ve bir tanesinde mermi vardir.
Oyunu bilgisayara karsi oynayacaksiniz!
Atislari mermi hazne numarasini(1,2,3,4,5,6) secerek yapacaksiniz\n""")
hazne=["",
"","",
"","",
""]
print(""" (0)
(1) (2)
(3) (4)
(5)
\n""")
import random
sayac=0
liste=[0,1,2,3,4,5]
while sayac<6:
try:
if sayac% 2 == 0:
secenek=int(input("Sira sizde,atis yapiniz:"))
if secenek==5:
print("Oldunuz!!!!!!!!!")
break
else:
liste.remove(secenek)
hazne[secenek]="X"
print(" ",hazne[:1],"\n",hazne[1:3],"\n",hazne[3:5],"\n"," ",hazne[5:],"\n"*2)
else:
atis= random.choice(liste)
print("Sira bilgisayarda:",atis)
if atis==5:
print("Oldum(Mermi 5'teymis), sen kazandin!!!!!")
break
else:
liste.remove(atis)
hazne[atis]="X"
print(" ",hazne[:1],"\n",hazne[1:3],"\n",hazne[3:5],"\n"," ",hazne[5:],"\n"*2)
sayac+=1
except ValueError:
print("Boyle bir hazne yok\n")