I am trying to get a list of strings that are permutations of letters, numbers and the dash that vary in length from 1 to 63.
I am using the permutation gem, and trying to get strings with join('')
.
length = 1
alphabet = [('a'..'z').to_a, ('0'..'9').to_a, ('-').to_a].flatten
while length < 64
puts (alphabet.permutation(length){|x| p x}).join('')
length += 1
end
The output I get is as follows:
["r", "q", "l"]
["r", "q", "m"]
I am sure I am missing something fundamental here. Any assistance greatly appreciated.