-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to use for a not even number of teams? #26
Comments
I'm not a pro in the matter either. But yes, BYEs are created for the purpose of filling the blanks when the number of participants isn't 2^N (by the way, I said "power of two", so it's not N^2 😁). It's only for seeding because it's just like a "null" team. It'll be propagated through the matches. Let's say you're expecting 4 participants but one won't be here, and you know it before doing the seeding. (or you can't welcome 16 participants and therefore expect 12, which is not a power of 2) You have:
You already know Team 3 will be the winner of the second match (it won't be played at all). So the next round will match the winner of the first match against Team 3. So BYEs can either be used to handle numbers of participants which are not a power of two, or to fill a blank when a participant can't be present. If it happens after the seeding is done and you can't affect the structure because some matches were already played, then you can use forfeits. Hope it clarifies a bit. Do not hesitate to ask more 😉 |
To precise my answer, the library is created on the idea that it will always be a number of teams that is 2^N. You won't be able to use it otherwise. But, you can use 2^N and fill in the blanks with BYEs, which I found is very common in this area. And quite a good workaround. |
I tried
but then I wanted to make a match as |
Right. It's bad behavior, it wasn't intended to do that... I'll correct that tomorrow and add tests about that. A new version will be published on I mostly wrote tests about my use cases. So yours are welcome! Edit: Actually, not wrong. |
Nice, thank you |
Okay. I just started investigating and actually it's normal behavior! Sorry, it was late yesterday 😂 BYE propagation and "automatic match winning" are done during the process of creating the stage with So you shouldn't have to do that:
It has already been done. Just read my test about BYE propagation: brackets-manager.js/test/double-elimination.spec.js Lines 44 to 68 in 42faa80
I understand they can be hard to read because I use direct access to IDs... But if you use my viewer (brackets-viewer.js), here is a visual representation of the result of the same test: And here, |
Nice! thank you for looking into this. And thanks for the visual representation. I tried to use it yesterday for one of the projects and realized that I have to re-implement the storage as I need in memory representation only and didn't realize |
Right now, as it is shipped, no you can't. Because the default storage interface implementation (for json) uses node.js file storage API... But you could easily write an implementation of the interface which uses either A pull request is welcome if you want to add your implementation |
Got it. PR may be tough as I will need get approval (per project based approval). I will look into storage interface. I briefly looked at it before and it looked more than a simple CRUD. Will give it a go. Thanks again for your help and responsiveness. |
I don't think it's far from a simple CRUD... maybe types make things feel harder. I've already written an implementation for a SQL storage in a private project, in JavaScript. I can post the code to give you a starting point if you want, because it's quite tedious 😁 |
I most likely will need to keep it in memory and once in awhile store as a simplified json blob. |
No, sorry. No paper nor videos. But I got a lot of inspiration from the website Toornament (you must create a free account), see the Credits section in the readme. If you want some help, you can contact me on Discord, if you have an account. |
Wanted to add another use case, as in our system if both teams do not show up and the we'll need to disqualify both of them. |
@nakullondhe when people do not show up but the tournament is already started, you should use forfeits instead of BYEs. |
are forfeits possible for both the team together? |
In an elimination tournament, a match must have a winner so forfeit for both teams isn't possible. This is not very likely that two teams on the same match forfeit at the same time. But you can set one as forfeit, let the other win, and forfeit it afterwards. But this is an edge case so I let the tournament organizer handle this. |
exactly why i asked this question. You have put win , loss, draw but nothing about forfeit. |
thanks for your quick response, that's what I was looking for. |
Hello,
thank you for putting together this library. I used it to understand the rules of double elimination.
I also quickly tried to use it to see if it can solve the case for a number of teams that is not N^2.
I am new to terminology and saw in the readme that BYE is used only for seeding, but not sure if that means I can't calculate games and their order using this library.
The text was updated successfully, but these errors were encountered: