Created
October 31, 2010 17:12
-
-
Save spangenberg/656842 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
require "whois" | |
class Array | |
def shuffle | |
sort_by { rand } | |
end | |
def shuffle! | |
self.replace shuffle | |
end | |
end | |
names = Array.new | |
50.times do |n| | |
v = %w(a e i o u) | |
k = %w(b c d f g h j k l m n p q r s t v w x y z) | |
output = "" | |
6.times do |i| | |
output += if i % 2 == 1 | |
v.shuffle! | |
v.delete(v[0]) | |
else | |
k.shuffle! | |
k.delete(k[0]) | |
end | |
end | |
unless names.include?(output) | |
names.push(output) | |
a = Whois.whois("#{output}.com") | |
puts "#{output}.com" if a.available? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment