World Cup group stage: Difference between revisions

m
Line 215:
=={{header|Elena}}==
{{trans|Java}}
ELENA 3.4.x :
<lang elena>import system'routines;
import extensions;
Line 227:
nextResult()
{
var s := results;
if (results=="222222") { ^ false };
Line 237 ⟶ 239:
{
var points := new IntMatrix(4, 10);
 
int counter := 0;
doUntildoWhile(program.nextResult().Inverted)
{
var records := new int[](4){0,0,0,0};
for(int i := 0, i < 6, i += 1)
Line 246 ⟶ 249:
var r := results[i];
r =>
"2" { records[games[i][0].toInt() - 49] +:= records[games[i][0].toInt() - 49] + 3 }
"1" {
records[games[i][0].toInt() - 49] +:= records[games[i][0].toInt() - 49] + 1;
records[games[i][1].toInt() - 49] +:= records[games[i][1].toInt() - 49] + 1
}
"0" { records[games[i][1].toInt() - 49] +:= records[games[i][1].toInt() - 49] + 3 };
};
records := records.ascendant();
for(int i := 0, i <= 3, i += 1) { points[i][records[i]] += 1 }
{
points[i][records[i]] := points[i][records[i]] + 1
}
};
Anonymous user