Skip to content

Instantly share code, notes, and snippets.

@dzfl
Created November 27, 2009 19:01
Show Gist options
  • Save dzfl/244175 to your computer and use it in GitHub Desktop.
Save dzfl/244175 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'readline'
class Naming
def initialize(argv)
@strs1 = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
@strs2 = ['E','F','H','I','K','L','M','N','T','V','W','X','Y','Z']
@strs3 = ['C','D','E','F','H','L','M','N','O','X','Z']
@strs4 = [ 'Y','H','B','U','J','N','I','K','M','O','L','P']
@strs5 = [ 'M','I','L','K','T','E','A']
@num = 0 < argv.to_i ? argv.to_i : 4
end
def run
make
while buf = Readline.readline("press enter key if you retry naming. (exit to CTRL-C) ", true)
make
end
end
def make
str = ""
@num.times do
str += @strs3.choice
end
p str.downcase
end
end
class Array
def choice
at( rand( size ) )
end
end
Naming.new(ARGV[0]).run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment