Drarig29 / brackets-manager.js

A simple library to manage tournament brackets (round-robin, single elimination, double elimination).
https://drarig29.github.io/brackets-docs
MIT License
253 stars 40 forks source link

Can't create a 256+ participants tournament without `seedOrdering` #133

Closed Drarig29 closed 2 years ago

Drarig29 commented 2 years ago

There is no defaultMinorOrdering for tournaments with 256 participants and more, so it throws this error:

TypeError: Cannot read property '0' of undefined
    at Create.getMajorOrdering (brackets-manager/src/create.ts:632:89)
    at Create.createLowerBracket (brackets-manager/src/create.ts:262:29)
    at Create.createDoubleElimination (brackets-manager/src/create.ts:181:41)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at Create.run (brackets-manager/src/create.ts:73:27)
    at BracketsManager.create (brackets-manager/src/create.ts:15:5)
    at BracketsManager.create (brackets-manager/src/manager.ts:58:9)
Drarig29 commented 2 years ago

I can't invent a default list of minor ordering for all the tournament size, so the max supported will be 128.

For 256 and more, it will default to full natural, and it will be up to the user to give a better ordering list, with the seedOrdering setting.

The defaults are here:

https://github.com/Drarig29/brackets-manager.js/blob/d8a934db0028302927f6cdff72f7655ac6049977/src/ordering.ts#L90-L98


Definition:

A minor ordering is an ordering method applied to the losers of a round of the winner bracket. They are moved in the loser bracket into a minor round.

A minor round is a loser bracket round with an even number, i.e. LB2, LB4...