Last active
December 29, 2015 00:19
-
-
Save jmoon90/7584561 to your computer and use it in GitHub Desktop.
Quick Challenge: Using what you know about arrays and through searching online with your review pair, write a small program for the hash supplied above that outputs the lines below. Write the program in a way where we could easily add more characters to the list and include them in the output.
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
| characters = { | |
| "Tyrion Lannister" => "House Lannister", | |
| "Jon Snow" => "Night's Watch", | |
| "Hodor" => "House Stark", | |
| "Stannis Baratheon" => "House Baratheon", | |
| "Theon Greyjoy" => "House Greyjoy" | |
| } | |
| characters.each do |name,house| | |
| puts "#{name} represents the #{house}" | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment