Skip to content

Instantly share code, notes, and snippets.

@seanhandley
Last active November 15, 2015 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanhandley/338d512afd71bf17ef71 to your computer and use it in GitHub Desktop.
Save seanhandley/338d512afd71bf17ef71 to your computer and use it in GitHub Desktop.
Einstein 14: Simpler option representation
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