-
Notifications
You must be signed in to change notification settings - Fork 4
new sorted tree method of pairing #7
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
base: master
Are you sure you want to change the base?
Conversation
swiss.rb
Outdated
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.
i was avoiding 1.9+ hash syntax so we could keep 1.8.7 compat, so you dont need to install new rubies to run this on a generic Mac lappy
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.
oh you are so right
i think this is what youre doing, if not, plz enlighten |
|
Not exactly- the problem with that approach is in some cases you can pick valid pairings all the way down, but still be left with two people who have already played each other at the bottom. what happens now is we do the old fashioned sort n slice, but if that doesn't work, do the following: once a chain is the required length you return it and we have the pairings. so this will be pretty random pairings but will all be valid. To make it less random we can sort all the potential pairings so the most desirable ones (people with the same match score) are considered first |
|
oh alright, your approach makes a lot more sense. I get it now. I see why you need the sorting part as well. |
|
this works now and i made it ruby 1.8.x compatible I THINK cc @nateberkopec |
|
Syntax check works on 1.8.7, I didn't debug anything else tho |
not ready for merge yet.cc @nateberkopec this takes care of no duplicate pairings with a sorted tree algorithm :P needs to be debugged/tested but take a look