Anonymous user
World Cup group stage: Difference between revisions
→version 2, generated game sets: optimized the nextResult function.
m (→version 2, generated game sets: aligned some statements better.) |
(→version 2, generated game sets: optimized the nextResult function.) |
||
Line 841:
end /*j*/
end /*k*/
z
say teams ' teams, ' sets " game sets: " gs /*display what's being used for calcs. */
results = copies(0, sets); say /*start with left-most teams all losing*/
Line 853:
end /*j*/
call sort teams
do t=1 for teams;
points.tm._ = points.tm._ + 1; z= max(z, length(points.tm._) )
end /*t*/
Line 873:
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
nextResult:
res= 0 /* [↓] do arithmetic in base three.*/
do
end /*j*/
results=; res= res + 1
Line 888:
end /*j*/; return
/*──────────────────────────────────────────────────────────────────────────────────────*/
th: arg th;
{{out|output|text= when using the default input of: <tt> 4 </tt>}}
<pre>
|