use truncating division
This commit is contained in:
parent
e73c66c679
commit
4cbe72c8e5
|
@ -15,7 +15,7 @@ def matchings(l):
|
||||||
result = []
|
result = []
|
||||||
for i in range(len(l)):
|
for i in range(len(l)):
|
||||||
matching = [(center, l[i])]
|
matching = [(center, l[i])]
|
||||||
for j in range(1, (len(l)-1)/2 + 1):
|
for j in range(1, (len(l)-1)//2 + 1):
|
||||||
matching.append((l[(i-j)%len(l)], l[(i+j)%len(l)]))
|
matching.append((l[(i-j)%len(l)], l[(i+j)%len(l)]))
|
||||||
result.append(matching)
|
result.append(matching)
|
||||||
return result
|
return result
|
||||||
|
@ -88,7 +88,7 @@ async def on_message(message):
|
||||||
pollination_channels = []
|
pollination_channels = []
|
||||||
channel_names = config['channel_names'].copy()
|
channel_names = config['channel_names'].copy()
|
||||||
exception_count = 0
|
exception_count = 0
|
||||||
while len(pollination_channels) < len(participants)/2:
|
while len(pollination_channels) < len(participants)//2:
|
||||||
if len(channel_names) > 0:
|
if len(channel_names) > 0:
|
||||||
name = channel_names.pop(0)
|
name = channel_names.pop(0)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue