-
Notifications
You must be signed in to change notification settings - Fork 13
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
Ladder #2
Comments
Yes!
Yes (I'll call this static mode), if you are going to decide the matches since the begining No (dynamic mode), If you support random matches and even manual challenges.
I dont thinks you need any logic, unscorable dont apply in ladder. Everybody starts with 0 and is adding.
Dynamic mode: let the user decide with two functions.
The last two. I don't know... I will need the ladder soon, maybe i can help :) |
Having statically sized ladder is essentially a league, and you can already do that by doing a group stage with group size === numPlayers. Though, it could possibly be wrapped nicely into a separate file. The dynamic clanbase model is harder as it doesn't really work with my abstraction:
That said, it is possible to impose a artificial limit on it (maybe a date limit) and then:
/first thoughts |
Well... Dynamic ladder is complicated with the current "round" abstraction. maybe this interface fit /**
* options
* matchesPerRound: <number>
* rounds: <number>
* searchArgo: <function>
*/
Ladder (numPlayers, options)
- createRandomMatch(pId, searchAlgo)
- challenge(pId, pId2)
- nextRound() //advance the round
- mirror() // get all matches and change the player order. Now an example var l = new Ladder(4, {matchesPerRound: 1, rounds: 2})
l.createRandomMatch(1);
// { id: { s: 1, r: 1, m: 1 }, p: [ 1, 2 ]}
l.createRandomMatch(3);
// { id: { s: 1, r: 1, m: 2 }, p: [ 3, 4 ]}
l.score({ s: 1, r: 1, m: 1}, [1,0])
// true
l.score({ s: 1, r: 1, m: 2}, [1,0])
// true
l.isRoundDone
// true
l.nextRound()
// { s: 1, r: 2}
l.createRandomMatch(2);
// { id: { s: 1, r: 2, m: 1 }, p: [ 2, 3 ]}
l.createRandomMatch(2); // maybe throw
// null
l.score({ s: 1, r: 2, m: 1}, [0,1])
l.isRoundDone
// false
l.nextRound() // player 1 and 4 didn't play, no problem
// null
l.isDone() // matchesPerRound
// true
// now the mirror
l.options.rounds = 4;
l.isDone() // we had extended the ladder...
// false
l.mirror();
l.upcoming(1)
// { id: { s: 1, r: 3, m: 1 }, p: [ 2, 1 ]}
l.upcoming(3)
// { id: { s: 1, r: 3, m: 2 }, p: [ 4, 3 ]}
l.nextRound()
// { id: { s: 1, r: 4, m: 1 }
l.upcoming(3)
// { id: { s: 1, r: 4, m: 1 }, p: [ 3, 2 ]}
l.upcoming(4)
// null
l.nextRound()
// null
l.isDone() // matchesPerRound
// true |
Dynamic tournaments are under way now - linking issue #14 so that it's thought about. |
Should we include a ladder type? I have little knowledge on how to do these well or what the controversies are with this more static tournament type so several questions have to be researched and argued clearly for and against. In particular:
The text was updated successfully, but these errors were encountered: