2 puts "Enter 2 < words < 10 (e.g. your interests etc) separated with commas: (full words length > 9 chars)"
4 word = gets.chomp.split(",")
6 word.length.times do |x|
7 word[x] = word[x].delete(" ")
8 len = len + word[x].length
10 end while word.length < 3 or word.length > 9 or len < 9 #check full length and words
11 #puts "Progress: " + word.join + "\n\n"
12 puts "Enter #{word.length} numbers separated with commas:"
14 number = gets.chomp.split(/[^0-9]/)
16 end while number.length != word.length
17 puts "The first letter of each word is substituted with chosen numbers,"
18 puts "the second letter of each word is upper-case,"
19 puts "and the last letter of each word is cool!"
20 chars = ')(*&^%$#@![]{}-=\|`~,./;<>?:"{}+_ '
21 number.length.times do |x|
22 word[x][0] = number.delete(number.sample) #pick random number and delete it (cannot repeat same number)
23 word[x][1] = word[x][1].chr.swapcase
24 word[x][-1] = chars.delete(chars.sample) #pick random char and ...
26 puts "\nFinal product: " + word.join
27 puts "Password saved." # :-)
29 puts "Check you password strength:
30 http://tools.pingates.com/password/
31 http://www.passwordmeter.com/
33 http://realeyes-tech.blogspot.com/2009/06/good-passwords.html"