Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aarongreenlee/791463 to your computer and use it in GitHub Desktop.
Save aarongreenlee/791463 to your computer and use it in GitHub Desktop.
Playing with arrays as I learn ruby.
# Aaron Greenlee
# http://aarongreenlee.com/
# Activity 2.1: Warmup 2
array1 = [1, 2, 3, 4]
array2 = %w{peter piper picked peppers}
array3 = []
array3 = array1.zip(array2).join(',').split(',')
if array3 == ['1', 'peter', '2', 'piper', '3', 'picked', '4', 'peppers']
puts "Success"
else
puts "Failed"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment