Skip to content
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

Initializing empty looser bracket (question) #19

Closed
LittleLama opened this issue May 22, 2014 · 3 comments
Closed

Initializing empty looser bracket (question) #19

LittleLama opened this issue May 22, 2014 · 3 comments
Labels

Comments

@LittleLama
Copy link

Hi,
I'm trying to init the bracket, with a complete but empty looser and final bracket.
Teams are known, but not results.
So I made a bigData var like :
"teams" : [ ["Team1","Team2"],["Team3","Team4"],["Team5","Team6"],["Team7","Team8"]],
"results" : [ ],[ ],[ ]

This gives only a single winner bracket. How can I get the others bracket too ?
Need I to init every empty matchs of tournament too (really heavy in code) ?

Thank you very much

@teijo
Copy link
Owner

teijo commented May 22, 2014

Try results: [[[[]]],[]].

I don't remember the exact logic anymore but that seemed to work for me.

@teijo teijo closed this as completed May 22, 2014
@teijo teijo added the question label May 22, 2014
@LittleLama
Copy link
Author

Works well with :

results : [
[ [[]] ] , //Double brackets in winner bracket
[ ] //Nothing in looser bracket
// No final bracket, works too if you write one
]

These double brackets are pretty mysterious for me. Maybe a syntax for the first match.

Thank you @teijo ! Great job !

@sheharyarn
Copy link

This worked for me for Double Elimination:

{
    teams : [
        ["Team 1", "Team 2"], 
        ["Team 3", "Team 4"],
        ["Team 5", "Team 6"],
        ["Team 7", "Team 8"]
    ],
    results :  [[[[]]],[],[]]
};

This value of results ([[[[]]],[],[]]) works for all powers of 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants