Skip to content

Commit 4d98e74

Browse files
authored
nPartyCoinFlip
Users can add parties that they want to add(not only 4 party)
1 parent b234b44 commit 4d98e74

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from cqc.pythonLib_protocols.coinflip_leader import CoinflipConsensus
2+
3+
4+
def main():
5+
6+
leaderChooser = CoinflipConsensus(arr)
7+
return leaderChooser.leader()
8+
9+
10+
11+
arr = []
12+
veri = input("Add person")
13+
while veri:
14+
arr.append(veri)
15+
veri = input("Add person")
16+
17+
18+
19+
d = dict()
20+
for veri in arr:
21+
d[veri] = 0
22+
23+
24+
for i in range(0, 20):
25+
if i % 10 == 0:
26+
print(i)
27+
d[main()] += 1
28+
29+
30+
print(d)

0 commit comments

Comments
 (0)