Skip to content

Instantly share code, notes, and snippets.

Created August 28, 2016 23:26
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 anonymous/d0cf856955b13ac2824f009eb226744d to your computer and use it in GitHub Desktop.
Save anonymous/d0cf856955b13ac2824f009eb226744d to your computer and use it in GitHub Desktop.
def recur_bruteforce(size, prefix='',&block)
ALPHABET.each_char do |char|
new_prefix = prefix + char
if size == 1
block.call new_prefix
else
recur_bruteforce(size - 1, new_prefix,&block)
end
end # Fin de alphabet.each_char
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment