Last active
April 7, 2016 14:26
-
-
Save tjr05d/9720905e5be1818628bb71055ebc8441 to your computer and use it in GitHub Desktop.
Ancient City Ruby Challenge
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
blocks = 10 | |
paths = 0 | |
blocks.times do | n | | |
paths += 2**(blocks - n) | |
end | |
puts "There are #{paths} distinct paths" | |
#There are 2046 distinct paths |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment