Conversation
swiss.rb
Outdated
There was a problem hiding this comment.
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
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