Skip to content

Instantly share code, notes, and snippets.

@Ahrry
Created October 21, 2011 13:05
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 Ahrry/1303798 to your computer and use it in GitHub Desktop.
Save Ahrry/1303798 to your computer and use it in GitHub Desktop.
exo 1
tab = []
15.times do |i|
tab << rand(100)
tab << "foo#{i}".to_sym
end
hash = {}
tab.each_with_index{|v, i| hash[v] = tab[i-1] if i.odd?}
puts hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment