Skip to content

Instantly share code, notes, and snippets.

@faizaanshamsi
Created November 19, 2013 00:22
Show Gist options
  • Save faizaanshamsi/7537872 to your computer and use it in GitHub Desktop.
Save faizaanshamsi/7537872 to your computer and use it in GitHub Desktop.
Version one, doesn't account for compound salutations.
salutations = [
'Mr.',
'Mrs.',
'Mr.',
'Dr.',
'Ms.'
]
first_names = [
'John',
'Jane',
'Sam',
'Louise',
'Kyle'
]
last_names = [
'Dillinger',
'Cook',
'Livingston',
'Levinger',
'Merlotte'
]
addresses = [
'33 Foolish Lane, Boston MA 02210',
'45 Cottage Way, Dartmouth, MA 02342',
"54 Sally's Court, Bridgewater, MA 02324",
'4534 Broadway, Boston, MA 02110',
'4231 Cynthia Drive, Raynham, MA 02767'
]
array = []
salutations.length.times do |x|
hash = {
salutations: salutations[x],
first_names: first_names[x],
last_names: last_names[x],
addresses: addresses[x]
}
array << hash
end
array.each do |x|
puts "#{x[:salutations]} #{x[:first_names]} #{x[:last_names]}"
puts x[:addresses], ""
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment