Fairshare between two and more: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (Add BCPL) |
Not a robot (talk | contribs) (add APL) |
||
Line 71: | Line 71: | ||
11: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 2, 3, 4 |
11: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 2, 3, 4 |
||
</pre> |
</pre> |
||
=={{header|APL}}== |
|||
{{works with|Dyalog APL}} |
|||
<syntaxhighlight lang="apl">fairshare ← ⊣|(+/⊥⍣¯1) |
|||
2 3 5 11 ∘.fairshare 0,⍳24</syntaxhighlight> |
|||
{{out}} |
|||
<pre>0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 0 |
|||
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 |
|||
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 |
|||
0 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 0 2 3 4</pre> |
|||
=={{header|AppleScript}}== |
=={{header|AppleScript}}== |