Created
February 18, 2011 15:50
-
-
Save cvonkleist/833850 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
ALPHABET = ['a'..'z', 'A'..'Z', '0'..'9'].collect { |range| range.to_a }.flatten | |
class Array; def random; self[rand(self.length)]; end; end | |
length = (ARGV.shift || 10).to_i | |
puts Array.new(length) { ALPHABET.random }.join |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment