Last active
November 15, 2015 11:20
-
-
Save seanhandley/338d512afd71bf17ef71 to your computer and use it in GitHub Desktop.
Einstein 14: Simpler option representation
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
colors = [:white, :yellow, :blue, :red, :green] | |
cigars = [:blends, :pall_mall, :prince, :bluemasters, :dunhill] | |
nationalities = [:german, :swedish, :british, :norwegian, :danish] | |
drinks = [:beer, :water, :tea, :milk, :coffee] | |
pets = [:birds, :cats, :horses, :fish, :dogs] | |
# Becomes: | |
c = [0,1,2,3,4] | |
s = [5,6,7,8,9] # Cigars becomes 's' for 'smokes' | |
n = [10,11,12,13,14] | |
d = [15,16,17,18,19] | |
a = [20,21,22,23,24] # p is the print method, so we use 'a' for 'animals' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment