Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chars = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a + ['!', '@', '#', '$', '%', '^', '&', '*']
- puts "panjang password: "
- length = gets.chomp.to_i
- password = Array.new(length) { chars.sample }.join
- puts "Password: #{password}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement