-
Notifications
You must be signed in to change notification settings - Fork 0
/
taixiu.py
97 lines (85 loc) · 1.79 KB
/
taixiu.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import random
a=["","","","","","","","",""]
def draw(x):
"""
012
345
678
"""
if x==1:
a[4]="*"
return a
elif x==2:
a[0]="*"
a[8]="*"
elif x==3:
a[0]="*"
a[4]="*"
a[8]="*"
return a
elif x==4:
a[0]="*"
a[2]="*"
a[6]="*"
a[8]="*"
elif x==5:
a[0]="*"
a[2]="*"
a[6]="*"
a[8]="*"
a[4]="*"
elif x==6:
a[0]="*"
a[2]="*"
a[6]="*"
a[8]="*"
a[1]="*"
a[7]="*"
return a
y="y"
while y=="y":
print("Tai press 1 Xiu press 0")
b=int(input(":"))
sum=0
a=[" "," "," "," "," "," "," "," "," "]
k=random.randrange(1,7,1)
draw(k)
sum+=k
print("+-------+")
print("|",a[0],a[1],a[2],"|")
print("|",a[3],a[4],a[5],"|")
print("|",a[6],a[7],a[8],"|")
print("+-------+")
a=[" "," "," "," "," "," "," "," "," "]
k=0
k=random.randrange(1,7,1)
draw(k)
sum+=k
print("+-------+")
print("|",a[0],a[1],a[2],"|")
print("|",a[3],a[4],a[5],"|")
print("|",a[6],a[7],a[8],"|")
print("+-------+")
a=[" "," "," "," "," "," "," "," "," "]
k=0
k=random.randrange(1,7,1)
draw(k)
sum+=k
print("+-------+")
print("|",a[0],a[1],a[2],"|")
print("|",a[3],a[4],a[5],"|")
print("|",a[6],a[7],a[8],"|")
print("+-------+")
if sum>=4 and sum<=10 and b==0:
print("You win")
print("want to play more ? y/n ")
y=inpuy(":")
elif sum>=11 and sum<=17 and b==1:
print("You win")
print("want to play more ? y/n ")
y=input(":")
else:
print("You lost")
print("want to play more ? y/n ")
y=input(":")
print("Good Night")