问题标签 [tournament]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
mysql - 如何从与比赛表相关的比赛表中得出比赛的获胜者?
在存储锦标赛的数据库中,我有这种关系结构来存储比赛及其比赛:
创建比赛时,根据比赛中的比赛数量插入一个比赛行和多个游戏行。然后还插入 Match_left 和 match_right 球员行,以将比赛中的两名球员与比赛行相关联。当玩家被记录为赢得游戏时,将与相应游戏相关的行插入到 game_winners 表中。有没有办法编写一个查询来从赢得比赛中得出谁赢得了比赛?也许从逻辑上讲,这应该是一个视图,以便我可以随时轻松地将匹配表行加入它?
我希望 Fred 作为 match_ID 1 的获胜者返回,因为他赢得了 2/3 场比赛。我希望 match_ID 2 的获胜者为空,因为两名球员都没有赢得必要的比赛数(2/3)。
algorithm - 比赛支架放置算法
给定一个对手种子列表(例如种子 1 到 16),我正在尝试编写一个算法,该算法将导致头号种子在该轮中扮演最低种子,第二种子扮演第二低种子,等等。
将 1 和 16、2 和 15 等分组为“比赛”相当容易,但我还需要确保较高的种子将在随后的轮次中与较低的种子比赛。
正确放置的示例支架:
如您所见,种子 1 和 2 只在决赛中相遇。
ruby-on-rails - 如何构建包含 ActiveResource 类的复杂多态关联?
我正在尝试构建一个多样化的锦标赛管理系统,该系统允许多种类型的锦标赛支架后端。目标是为锦标赛括号后端(此处为PlasTournament
)提供一个非常简单的选项,并提供多个更复杂的后端(现在,只是Challonge::Tournament
来自Challonge,通过其API使用challonge-api gem )。
我的模型:
还有Challonge::Tournament
,但我不知道如何让它适合这种风格。我需要猴子补丁吗?它是一个 ActiveResource 类,我真的只需要在类的多态关联中存储Tournament
它的类和 id。
我以前有这些模型:
或类似的东西。它没有用,我没有像上面那样提交它。
理想情况下,我希望能够在我的控制器的create
方法中做这样的事情(我知道其中一些可以通过传递params[:tournament]
给#new来处理;我只是在这个例子中明确表示):
然后在Tournament#show
做这样的事情:
然后,在视图中,我可以根据remote
.
我是不是摇摆不定?这看起来相当简单,但我认为我陷入了 Rails 的实现细节中。
我正在寻找的本质上是一种将多态锦标赛包围系统隐藏在锦标赛类后面的方法。
php - Tournament bracket with user input (php?)
Basically I would like some help on how to implement my idea. Any direction would be appreciated. I'm not sure what languages I should be using, or if I need a MySQL database of some kind.
I want to make a tournament bracket. I've read several posts on here about brackets but I couldn't find a solution.
I want to present the user with two options, pulled from a pool of about 16 choices. The two options would be randomly selected from the pool. The user will then pick the "better" or "best" option out of the two choices presented to him. After that "matchup" the pool would then be reduced to the remaining choices in pool, which would be 14. Immediately after the matchup, the user would then be presented with another two options, and the process will then repeat itself until all of the options in the pool have been used. There are 8 matchups in the first round, and then the matchups will continue until a single winner is selected. Also note that this bracket is not determined by score, but purely based on the user input (which one of the two choices he likes better). The end result is a visual bracket of the sole winner, and the other losing options based on the user inputs. This would require storing the users input in a database I suppose.
Here is a viauallization of a classic tournament bracket with 16 options.
Anyway, I would like to know how to implement/code this. I am very comfortable with HTML/CSS and I know very little PHP. I have setup databases and stuff like that.
Thoughts?
c++ - 如何确定树中的元素(锦标赛括号)?
假设我们有以下树:
其中元素(匹配):
1-8 是第 1 轮
9-12 是第 2 轮
13-14 是第 3 轮
15 是第 4 轮
如何确定树中元素“n”的轮次?
我目前的公式是:
php - PHP 比赛支架系统
祝大家新年快乐!!
我正在尝试为我和朋友制作星际争霸 2 锦标赛网站。
我坚持锦标赛系统。
我有一个制作括号的 jquery 脚本,但我不知道如何用我的数据库和 php 实现它:(
我想问你一些问题。
我有这个 html 和 jquery 脚本。
我的mysql数据库是这样的
和
和用户表
我试着这样做
但它给了我这个
根据我的数据库,有 4 个团队,但使用我的 php 脚本,它给了我 7 个匹配项。它应该只有2场比赛。因为有4个团队。
我就是想不通。有没有人可以给我一个想法或帮助我?谢谢
c# - 优化锦标赛的括号
我正在构建一个系统,该系统将根据竞争者列表创建锦标赛。
竞争者具有可能无法将他们放在括号中的属性,例如性别、体重、技能水平等。
在某些情况下,这会变得非常复杂:
- 竞争者可能会上升一个体重等级,但永远不会下降
- 在一定年龄下,性别可能是混合的。
什么是让这些人进入最佳括号的好方法(例如,4、8、16 的尺寸)?在不尝试所有排列的情况下,是否有一个已知的算法?
selection - 比赛选择
我试图用锦标赛选择来实现一个 GA,但我有点困惑。我知道首先我们从整个人口中随机选择 k 个成员。然后我们使用锦标赛规模(假设 ts=2)选择最好的一个。然后我们将获胜者添加到交配池中进行交叉。但我也知道我必须填满交配池,直到它再次达到 k 大小。在这种情况下,如果我选择的 k 个候选者始终是相同的选择者,那么交配池会不会与所选群体相同?还是每一步我都必须为新的获胜者选择 k 成员?有一点帮助吗?
c# - Double Elimination Tournament Algorithm for byes %4
I'm trying to code a Double Elimination tournament where the brackets are based on mod 4. The first round should handle all of the byes so that after round 2 there will be no more byes. I'm having a hard time trying to figure out the actual math behind determining the amount of byes I need. If anyone can help me with the math behind this it would be greatly appreciated.
There are 4 possible answers for anything mod 4 (0,1,2,3) I need to handle byes for 1,2,3.
An example of what I mean is 13 players so (13%4=1) so the round 1 bracket should look like 1vs2 2vs3 3vs4 4vs5 5vs6
and round 2 is 7vs winner 8vs winner 9vs winner winner vs winner and then you have the losers bracket
Basically if your familiar with the website Challenge, I want to generate my brackets similar to them, but I can't figure out the math behind their determining of the byes.
If anybody has done something similar to this I would greatly appreciate his help.