Skip to content

Instantly share code, notes, and snippets.

@timothyw
Created February 10, 2010 01: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 timothyw/299901 to your computer and use it in GitHub Desktop.
Save timothyw/299901 to your computer and use it in GitHub Desktop.
def test(n)
if n <= 0
return [[]]
else
return test(n-1).map do |x| [true] + x end + test(n-1).map do |x| [false] + x end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment