World Cup group stage: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 215: | Line 215: | ||
=={{header|Elena}}== |
=={{header|Elena}}== |
||
{{trans|Java}} |
{{trans|Java}} |
||
ELENA 4. |
ELENA 4.1 : |
||
<lang elena>import system'routines; |
<lang elena>import system'routines; |
||
import extensions; |
import extensions; |
||
Line 221: | Line 221: | ||
public singleton program |
public singleton program |
||
{ |
{ |
||
static games := new string[] |
static games := new string[]::("12", "13", "14", "23", "24", "34"); |
||
static results := "000000"; |
static results := "000000"; |
||
Line 228: | Line 228: | ||
{ |
{ |
||
var s := results; |
var s := results; |
||
if (results=="222222") { ^ false }; |
if (results=="222222") { ^ false }; |
||
Line 239: | Line 239: | ||
{ |
{ |
||
var points := new IntMatrix(4, 10); |
var points := new IntMatrix(4, 10); |
||
int counter := 0; |
int counter := 0; |
||
do |
|||
{ |
{ |
||
var records := new int[] |
var records := new int[]::(0,0,0,0); |
||
for(int i := 0, i < 6, i += 1) |
for(int i := 0, i < 6, i += 1) |
||
Line 263: | Line 263: | ||
points[i][records[i]] := points[i][records[i]] + 1 |
points[i][records[i]] := points[i][records[i]] + 1 |
||
} |
} |
||
} |
} |
||
while:(program.nextResult()); |
|||
new Range(0, 4).zipForEach(new string[] |
new Range(0, 4).zipForEach(new string[]::("1st", "2nd", "3rd", "4th"), (i,l) |
||
{ |
{ |
||
console.printLine(l,": ", points[3 - i].toArray()) |
console.printLine(l,": ", points[3 - i].toArray()) |