Created
January 22, 2011 20:55
-
-
Save aarongreenlee/791463 to your computer and use it in GitHub Desktop.
Playing with arrays as I learn ruby.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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