Created
February 12, 2016 02:21
-
-
Save stmtk1/bd72804438f3ca9f02f9 to your computer and use it in GitHub Desktop.
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
def input_str | |
ret = [] | |
ret.concat(("a".."z").to_a) | |
ret.concat(("A".."Z").to_a) | |
ret.concat(("0".."9").to_a) | |
return ret | |
end | |
INPUT = input_str() | |
def write_pass(input) | |
end | |
def pass_str(count) | |
ret = [""] | |
for i in 0...count | |
pass_clone = ret.clone | |
ret = [] | |
pass_clone.each do |pass| | |
INPUT.each do |input| | |
ret.push(pass + input) | |
puts pass + input | |
end | |
end | |
end | |
return ret | |
end | |
for i in 1..4 | |
pass_str(i) | |
end | |
=begin | |
pass_str(4).each do |pass| | |
INPUT.each do |input| | |
puts pass + input | |
end | |
end | |
=end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how to use: ruby char_combination.rb > result.txt