Round-robin tournament schedule: Difference between revisions
→{{header|Wren}}: Simplified.
(→{{header|Wren}}: Simplified.) |
|||
Line 186:
<lang ecmascript>import "./fmt" for Fmt
var
var last = lst[-1]
for (i in lst.count-1..1) lst[i] = lst[i-1]
lst[0] = last
}
var roundRobin = Fn.new { |n|
var
var rounds = n - 1
if (n % 2 == 1) {
rounds = n
n = n + 1
}
var n2 = rounds / 2
for (round in 1..rounds) {
Fmt.write("Round $2d", round)
var
for (i in 0...n2) Fmt.write(" ($2d vs $-2d)",
System.print()
}
}
|