Last active
November 14, 2015 21:09
-
-
Save seanhandley/6a15c51431080612f2ec to your computer and use it in GitHub Desktop.
Einstein 2: Nesting the loops
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
[:white, :yellow, :blue, :red, :green].permutation.each do |colors| | |
[:german, :swedish, :british, :norwegian, :danish,].permutation.each do |nationalities| | |
[:birds, :cats, :horses, :fish, :dogs].permutation.each do |pets| | |
[:beer, :water, :tea, :milk, :coffee].permutation.each do |drinks| | |
[:blends, :pall_mall, :prince, :bluemasters, :dunhill].permutation.each do |cigars| | |
# ... | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment