Created
April 17, 2016 19:47
-
-
Save shirts/a0eaa0569706dc7c03e7fef4d62f7986 to your computer and use it in GitHub Desktop.
Ruby Combination Generator
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
# uses gem combination_generator | |
# generates all possible 8 character combinations for letters A-Z | |
# writes combinations to file combinations.txt | |
require 'combination_generator' | |
alphabet = ('a'..'z').to_a.map(&:upcase!) | |
combinations = [] | |
CombinationGenerator.new(8, alphabet).each {|combo| combinations << combo } | |
f = File.new 'combinations.txt', 'w' | |
f.write(combinations) | |
f.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment