Skip to content

Instantly share code, notes, and snippets.

@stmtk1
Created February 12, 2016 02:21
Show Gist options
  • Save stmtk1/bd72804438f3ca9f02f9 to your computer and use it in GitHub Desktop.
Save stmtk1/bd72804438f3ca9f02f9 to your computer and use it in GitHub Desktop.
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
@stmtk1
Copy link
Author

stmtk1 commented Feb 12, 2016

how to use: ruby char_combination.rb > result.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment