Skip to content

Instantly share code, notes, and snippets.

View danielbonnell's full-sized avatar

Daniel Bonnell danielbonnell

  • HDI AG
  • Hannover, Deutschland
View GitHub Profile
@danielbonnell
danielbonnell / round_robin.rb
Last active August 29, 2015 14:08
Round Robin Challenge
def schedule_tournament(names)
matches = names.product(names)
rounds = []
matches.sort!.each do |sub|
sub.sort!
matches.delete(sub) if sub[0] == sub[1]
end
matches.uniq!
@danielbonnell
danielbonnell / cats.rb
Created November 13, 2014 13:36
Apollo: building-compound-data-structures
favorite_movies = [{ title: 'The Big Lebowski', year_released: 1998, director: 'Joel Coen', imdb_rating: 8.2 }, { title: 'The Shining', year_released: 1980, director: 'Stanley Kubrick', imdb_rating: 8.5 }, { title: 'Troll 2', year_released: 1990, directory: 'Claudio Fragasso', imdb_rating: 2.5 }]
favorite_movies.each do |movie|
puts "#{movie[:year_released]}: #{movie[:title]}"
end