Skip to content

Instantly share code, notes, and snippets.

@DrewWeth
Created October 9, 2014 06:21
Show Gist options
  • Save DrewWeth/57ff193b3710298a7b51 to your computer and use it in GitHub Desktop.
Save DrewWeth/57ff193b3710298a7b51 to your computer and use it in GitHub Desktop.
a = "123"
hash = { 1 => 'a',
2 => 'b',
3 => 'd'}
a = a.split('').each do |variable|
puts hash[variable.to_i]
end
b = a.product(a)
puts b.inspect
puts "test hash: " << hash[1].to_s
b.each do |c|
# puts c[1]
puts c[0]
puts hash[c[0].to_i] + hash[c[1].to_i]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment