-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tambola Ticket Checker.py
106 lines (104 loc) · 3.72 KB
/
Tambola Ticket Checker.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
95
96
97
98
99
100
101
102
103
104
105
106
"""
Created on Sun Jul 26 09:46:35 2020
@author: Shafin()
"""
print("How many Ticket You Have?")
n= int(input())
tickets=[]
for i in range(n):
print("enter your ticket no:")
tickets.append([input()])
print("Enter Line 1:")
tickets[i] = tickets[i]+[["1st Line"]+list(map(int,input().split()))]
print("Enter Line 2:")
tickets[i] = tickets[i]+[["2nd Line"]+list(map(int,input().split()))]
print("Enter Line 3:")
tickets[i] = tickets[i]+[["3rd Line"]+list(map(int,input().split()))]
tickets[i] = tickets[i] + [[" ",tickets[i][1][1],tickets[i][1][5],tickets[i][3][1],tickets[i][3][5]]]
tickets[i] = tickets[i] +[[5]]
print(tickets)
housie=3
fourcorner=1
earlyfi=1
l1=1
l2=1
l3=1
nums=[]
while True:
try:
x=int(input().strip())
for i in tickets:
for j in range(1,5):
if type(i[j]) !=type("") and x in i[j]:
i[j].remove(x)
nums = nums +[x]
#i[5][0] = i[5][0]-1
print(str(x)+" in "+i[0]+" "+i[j][0])
if len(i[4]) == 1 and fourcorner !=0 :
fourcorner = fourcorner -1
print("::::::::::::::::::::::::::")
print("::::::::::::::::::::::::::")
print("WON 4 corners"+" in "+i[0]+" ")
print("::::::::::::::::::::::::::")
print("::::::::::::::::::::::::::")
#print(i[5][0])
if len(i[1])+len(i[2])+len(i[3]) == 13 and earlyfi !=0:
earlyfi = earlyfi -1
print("::::::::::::::::::::::::::")
print("::::::::::::::::::::::::::")
print("WON Early 5"+" in "+i[0]+" ")
print("::::::::::::::::::::::::::")
print("::::::::::::::::::::::::::")
if len(i[1]) == 1 and l1 != 0 :
l1 = l1 - 1
print("::::::::::::::::::::::::::")
print("::::::::::::::::::::::::::")
print("WON 1st Line in "+i[0])
print("::::::::::::::::::::::::::")
print("::::::::::::::::::::::::::")
if len(i[2]) == 1 and l2 != 0 :
l2 = l2 - 1
print("::::::::::::::::::::::::::")
print("::::::::::::::::::::::::::")
print("WON 2nd Line in "+i[0])
print("::::::::::::::::::::::::::")
print("::::::::::::::::::::::::::")
if len(i[3]) == 1 and l3 != 0 :
l3 = l3 - 1
print("::::::::::::::::::::::::::")
print("::::::::::::::::::::::::::")
print("WON 3rd Line in "+i[0])
print("::::::::::::::::::::::::::")
print("::::::::::::::::::::::::::")
if len(i[1])+len(i[2])+len(i[3]) == 3 and housie != 0:
housie = housie -1
print("::::::::::::::::::::::::::")
print("::::::::::::::::::::::::::")
print("HOUSIE of "+str(i[0]))
print("::::::::::::::::::::::::::")
print("::::::::::::::::::::::::::")
except:
y = input()
if y == "quit":
break
if y == "nums":
print(nums)
if y == "h":
if housie !=0:
housie = housie - 1
if y == "ef":
if earlyfi !=0:
earlyfi = earlyfi - 1
if y == "fc":
if fourcorner !=0:
fourcorner = fourcorner - 1
if y == "l1":
if l1 !=0:
l1 = l1 - 1
if y == "l2":
if l2 !=0:
l2 = l2 - 1
if y == "l2":
if l2 !=0:
l2 = l2 - 1
continue