- Jun 6, 2020
- 11,559
- 4,422
My math knowledge (high school) has gone way down.
I'm looking for a nice algorithm:
<
Four teams in a group all play against each other once.
If scores are possible: 1-0, 1-1, 0-1
How do I get all possible results in an array.
>
For example:
---
teamA-teamB 1-0
teamA-teamC 1-0
teamA-teamD 1-0
teamB-teamD 1-0
---
teamA-teamB 1-0
teamA-teamC 1-0
teamA-teamD 1-0
teamB-teamD 1-1
---
And so on.
I'm looking for a nice algorithm:
<
Four teams in a group all play against each other once.
If scores are possible: 1-0, 1-1, 0-1
How do I get all possible results in an array.
>
For example:
---
teamA-teamB 1-0
teamA-teamC 1-0
teamA-teamD 1-0
teamB-teamD 1-0
---
teamA-teamB 1-0
teamA-teamC 1-0
teamA-teamD 1-0
teamB-teamD 1-1
---
And so on.
برای دیدن لینک ها باید ثبت نام کنید