-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbigbldcomparison.py
58 lines (44 loc) · 2.03 KB
/
bigbldcomparison.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
#!/usr/bin/python
from db import WCA_Database
cur = WCA_Database.query("SELECT eventId, personId, best FROM RanksSingle WHERE eventId = '333bf' GROUP BY personId")
bld = cur.fetchall()
cur.execute("SELECT eventId, personId, best FROM RanksSingle WHERE eventId = '444bf' GROUP BY personId")
fobf = cur.fetchall()
cur.execute("SELECT eventId, personId, best FROM RanksSingle WHERE eventId = '555bf' GROUP BY personId")
fibf = cur.fetchall()
#Check for 5BLD > 4BLD if 4BLD success
print('5BLD > 4BLD:')
for i in range(0,len(fobf)):
for k in range(0,len(fibf)):
if fobf[i]['personId'] == fibf[k]['personId']:
if fobf[i]['best'] > fibf[k]['best']:
print(fobf[i]['personId'], fobf[i]['best'], fibf[k]['best'])
#Check for 4BLD > 3BLD if 3BLD success
print('4BLD > 3BLD:')
for i in range(0,len(bld)):
for k in range(0,len(fobf)):
if bld[i]['personId'] == fobf[k]['personId']:
if bld[i]['best'] > fobf[k]['best']:
print(bld[i]['personId'], bld[i]['best'], fobf[k]['best'])
#Check for 5BLD > 3BLD if 3BLD success
print('5BLD > 3BLD:')
for i in range(0,len(bld)):
for k in range(0,len(fibf)):
if bld[i]['personId'] == fibf[k]['personId']:
if bld[i]['best'] > fibf[k]['best']:
print(bld[i]['personId'], bld[i]['best'], fibf[k]['best'])
#Check for 4BLD success without 3BLD success
print('4BLD without 3BLD:')
for k in range(0,len(fobf)):
if (all(fobf[k]['personId'] != bld[i]['personId'] for i in range(0,len(bld)))):
print(fobf[k]['personId'], fobf[k]['best'])
#Check for 5BLD success without 3BLD success
print('5BLD without 3BLD:')
for k in range(0,len(fibf)):
if (all(fibf[k]['personId'] != bld[i]['personId'] for i in range(0,len(bld)))):
print(fibf[k]['personId'], fibf[k]['best'])
#Check for 5BLD success without 4BLD success
print('5BLD without 4BLD:')
for k in range(0,len(fibf)):
if (all(fibf[k]['personId'] != fobf[i]['personId'] for i in range(0,len(fobf)))):
print(fibf[k]['personId'], fibf[k]['best'])