Last active
December 18, 2015 08:09
-
-
Save joegiralt/5751992 to your computer and use it in GitHub Desktop.
homework
This file contains hidden or 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
# Construct an array with your favorite foods. It should have at least 5 elements. | |
favorite_foods = ["Chicken tikka Masalla", | |
"Roasted Rabbit", | |
"Fried Ocra", | |
"Chanterelle Mushroom Soup", | |
"Pan Seared Skirt Steak"] | |
# Write a puts which returns your most favorite food out of the array. | |
puts favorite_foods[1] | |
# Construct an array with the colors of the rainbow (ROYGBIV) | |
prism = ["red", | |
"orange", | |
"yellow", | |
"green", | |
"blue", | |
"indigo", | |
"violet"] | |
# Slice the colors Red, Orange, and Yellow out of the array. | |
prism.slice(0..2) | |
# Create an empty array. | |
empty_array = [] | |
# # Assign values to the the second and 6th position. | |
empty_array[1] & empty_array[6] = 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment