Round-robin tournament schedule: Difference between revisions

Content added Content deleted
No edit summary
Line 11: Line 11:
<br>
<br>


=={{header|APL}}==
<syntaxhighlight lang="APL">
∇ SCHEDULER N;R;I
R←(⍳N),(2|N)⍴'-'
I←0 ⋄ N←⍴(R)
L:⎕←'ROUND',I←I+1
⎕←((N÷2)↑R),[0.5]⌽(N÷2)↓R
R←(1↑R),1⌽1↓R
→(I<N-1)/L
</syntaxhighlight>
{{out}}
<pre>
SCHEDULER 4
ROUND 1
1 2
4 3
ROUND 2
1 3
2 4
ROUND 3
1 4
3 2
</pre>
=={{header|AWK}}==
=={{header|AWK}}==
<syntaxhighlight lang="awk">
<syntaxhighlight lang="awk">
Line 113: Line 137:
2 12 11 10 9 8
2 12 11 10 9 8
</pre>
</pre>

=={{header|FreeBASIC}}==
=={{header|FreeBASIC}}==
<syntaxhighlight lang="freebasic">function nob( n as uinteger, i as uinteger, bye as boolean ) as string
<syntaxhighlight lang="freebasic">function nob( n as uinteger, i as uinteger, bye as boolean ) as string