Round-robin tournament schedule: Difference between revisions

m
→‎{{header|J}}: alternative display of id pairs
m (→‎{{header|J}}: grammar)
m (→‎{{header|J}}: alternative display of id pairs)
Line 309:
 
(Here, <code>circ</code> uses index values which start at zero, so we need to add 1 to every index. Then we form the id pairs as complex numbers and replace the 'j' used to separate real from imaginary in their character representation with ':' for a hopefully compact and easy-to-read display.)
 
((Note that we could have instead centered each id pair on the ':' with only slightly more work. But it's not clear that that results in a more pleasing display.)):
 
<syntaxhighlight lang=J> ,/"2(' ',_2&{.@[,':',2&{.@])&":/"1>:circ 12
1:12 2:11 3:10 4:9 5:8 6:7
1:2 3:12 4:11 5:10 6:9 7:8
1:3 4:2 5:12 6:11 7:10 8:9
1:4 5:3 6:2 7:12 8:11 9:10
1:5 6:4 7:3 8:2 9:12 10:11
1:6 7:5 8:4 9:3 10:2 11:12
1:7 8:6 9:5 10:4 11:3 12:2
1:8 9:7 10:6 11:5 12:4 2:3
1:9 10:8 11:7 12:6 2:5 3:4
1:10 11:9 12:8 2:7 3:6 4:5
1:11 12:10 2:9 3:8 4:7 5:6
</syntaxhighlight>
 
=={{header|Julia}}==
6,951

edits