Created
August 13, 2014 21:24
-
-
Save justincampbell/cd18ce823f0d3a4745d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby pairs-using-pairs.rb | |
Jeff & Dan | |
Jason & Dotcom | |
Mox & Jearvon | |
Mike & Matt | |
Justin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pairs' | |
pairs = Pairs.new do | |
senior "Dan" | |
senior "Jason" | |
senior "Jeff" | |
senior "Justin" | |
senior "Matt" | |
senior "Mike" | |
senior "Mox" | |
junior "Dotcom" | |
junior "Jearvon" | |
constraint { |a, b| !(junior?(a) && junior?(b)) } | |
separate "Jason", "Mike" | |
together "Mox", "Jearvon" | |
alone "Justin" | |
end | |
pairs.solution.each do |pair| | |
puts pair.join(' & ') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment