Skip to content

Instantly share code, notes, and snippets.

@samtalks
Last active December 24, 2015 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samtalks/6801868 to your computer and use it in GitHub Desktop.
Save samtalks/6801868 to your computer and use it in GitHub Desktop.
pigeons = []
pigeon_list = {}
pigeon_data.each {|properties, properties_hash| pigeon_data[properties].
each {|property, birds| pigeons += birds}}
pigeons.uniq!
pigeons.each do |pigeon|
pigeon_list[pigeon] = {:color => [], :gender => "", :lives => ""}
pigeon_data.each do |properties,properties_hash|
pigeon_data[properties].each do |property, birds|
pigeon_list[pigeon][properties] << property.to_s if birds.include?(pigeon)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment