Created
September 24, 2017 16:58
-
-
Save ssaunier/3de07fc5ef74544f145028b102cde3ed 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
# Usage: run `ruby buddies.rb` | |
begin | |
require "round_robin_tournament" | |
rescue LoadError | |
puts "Could not find gem 'round_robin_tournament'" | |
puts "Install it with:" | |
puts | |
puts " gem install round_robin_tournament" | |
exit 1 | |
end | |
puts "Which module?" | |
puts "1: Tooling" | |
puts "2: React-Basics" | |
puts "3: React-Advanced" | |
puts "4: Redux-Basics" | |
puts "5: Redux-Advanced" | |
puts "6: React-Plugins" | |
puts "7: React-Testing" | |
puts "8: React-in-Rails" | |
print "> " | |
number = gets.chomp.to_i | |
students = %w(regiomag charlesbenard finnpedersenkazes ManyBaby Willgg davidgeismar juliends antoineayoub Atheane kara22 brunolajoie jeremy-israel Guillaumejfrt Bsolene) | |
max_length = students.map(&:length).max | |
teams = RoundRobinTournament.schedule(students) | |
day_teams = teams[number - 1] | |
day_teams.each do |day_team| | |
puts "#{day_team.first.rjust(max_length)} <=> #{day_team.last.ljust(max_length)}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment