Code:
[code]
print "How many characters do you want in your password?: "
characters = gets.chomp
puts "1) Yes"
puts "2) No"
print "Do you want numbers?: "
numbers = gets.chomp
characters = characters.to_i
numbers = numbers.to_i
if numbers == 2
while 0 < characters
characters = characters - 1
password = (?a.ord + rand(26)).chr
print password
end
end
if numbers == 1
characters = characters / 2
while 0 < characters
characters = characters - 1
password = (?a.ord + rand(26)).chr
passwordnumber = rand(10)
print password, passwordnumber
end
end
puts ""
Sorry for bumping, but this is useful thanks !
I'll try it. Thanks for it ;)
I will try for sure. Thanks for the share.
(03-23-2010, 10:16 PM)nevets04 Wrote: [ -> ]Code:
[code]
print "How many characters do you want in your password?: "
characters = gets.chomp
puts "1) Yes"
puts "2) No"
print "Do you want numbers?: "
numbers = gets.chomp
characters = characters.to_i
numbers = numbers.to_i
if numbers == 2
while 0 < characters
characters = characters - 1
password = (?a.ord + rand(26)).chr
print password
end
end
if numbers == 1
characters = characters / 2
while 0 < characters
characters = characters - 1
password = (?a.ord + rand(26)).chr
passwordnumber = rand(10)
print password, passwordnumber
end
end
puts ""
good work friend!
Thank you man, I am going to check it out.
This is very usefull thanks for the source code.
I am trying now, but so far it seems like there have been good results.
I'm going to check and test it out soon, but thanks for sharing. Much appreciated!