Jump to content

Fairshare between two and more: Difference between revisions

(Change test to eleven people invalidates all examples so far, but emphasises use case of sharing fairly when b>10.)
(→‎{{header|Python}}: Update to 11)
Line 72:
 
if __name__ == '__main__':
for b in (2, 3, 5, 711):
print(f"{b:>2}: {str(list(islice(fairshare(b), 25)))[1:-1]}")</lang>
 
Line 79:
3: 0, 1, 2, 1, 2, 0, 2, 0, 1, 1, 2, 0, 2, 0, 1, 0, 1, 2, 2, 0, 1, 0, 1, 2, 1
5: 0, 1, 2, 3, 4, 1, 2, 3, 4, 0, 2, 3, 4, 0, 1, 3, 4, 0, 1, 2, 4, 0, 1, 2, 3
711: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 07, 28, 39, 4, 5, 610, 0, 12, 3, 4, 5, 6</pre>
 
=={{header|Sidef}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.