-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fairly assign home/away matches amongst players #3
Fairly assign home/away matches amongst players #3
Conversation
I think this is a great idea, and it's handled very gracefully. I agree that a major is needed (even though the interface itself is unchanged, and the change will likely go under the radar), as it does change determinism of groupstages higher up the stack, so people trying to resume a tournament might be confused. Will leave a few questions on the PR, but overall the thing looks pretty good right of the bat. Thanks a lot for doing this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
questions on order and a seed suggestion
Perhaps we should also update |
Done in commit 6d06751. How does it look? |
Looks great :-) As a somewhat amusing sidenote; this will be the second ever update to this library. Last PR was ~7 years ago (issue #1). |
Haha, yeah I know this repo is a bit old but while I was working on a React Native side project I needed to lay out teams in a round robin format and I thought I'd see if anyone had done it yet. Turns out you had, I just needed to add home/away support. Figured I'd open a PR rather than just keep the changes to myself :) |
Definitely appreciated :-) |
|
I really like your use of the circle method here, however, when using
robin()
I found myself wanting to fairly assign "home" matches to players, meaning that in the event of an odd number of players, each player has the same amount of home matches:or in the event of an even number of players, each player has at most 1 more/less home match:
This PR accomplishes this.
This method was also mentioned in the wiki article you referenced in
robin.js
I also bumped the version to
2.0.0
as some might see this as a breaking change if they for some reason relied on the order of the match arrays (although I doubt it because the[ away, home ]
concept is new and I don't see why else the order would matter).Let me know what you think :)