C#巡回赛锦标赛安排了2位以上的玩家进行比赛

时间:2019-12-14 16:06:21

标签: c# arrays arraylist methods combinations

我想为BGG锦标赛制作免费程序,但是我坚持比赛的算法。我知道什么是基本的循环赛,我已经决定今年进行循环赛,但至少对于我来说,这有点复杂,因为球员人数不定,而且每场比赛的人数都不一样,必须设置最大的回合数。...所以这不像在锦标赛生成器中投入名称那样简单。

通常情况下,循环赛是1比1,“ 1”可能是一个由固定数目的球员组成的球队(例如,一个足球队由11名球员组成),但是我想要实现的目标是输入以下变量:

List<Player> players
int playerCountForMatch
int numberOfMatchContemporary
int maxSetOfRound

作为输出,它给了我一个列表,其中每个玩家与所有其他玩家至少玩1次。

让我们举个例子:

INPUT

\\Let's say that the Player class has only one property called ID as int. and in this example we have 12 object inside the list
List<Player> players 

\\Let's say that is 4 player for each match
int playerCountForMatch

\\Let's say that there is physical 3 places to make the match
int numberOfMatchContemporary

\\Let's say that we want to make at least 2 Round
int maxSetOfRound

所以输出可能是:

Round 1: {01 02 03 04}   {05 06 07 08}   {09 10 11 12}
Round 2: {10 01 09 05}   {02 06 11 12}   {03 07 04 12}

一旦我开始尝试对组合进行布局,就会使我失望。我不确定它们是否是可靠的方法。我怀疑有很多这样的轮循机制,所以搜索时找不到很多东西。

我只是希望它尽可能公平。任何帮助表示赞赏。

0 个答案:

没有答案