Skip to content

Instantly share code, notes, and snippets.

@nguyendangminh
Last active August 29, 2015 14:09
Show Gist options
  • Save nguyendangminh/932718c893be76d03acd to your computer and use it in GitHub Desktop.
Save nguyendangminh/932718c893be76d03acd to your computer and use it in GitHub Desktop.
Rubyist
# default value
PHRASE_FIRST = ARGV[0] == "english"
open(aFile) {|f|
f.each_line {|word| words.push(word.chomp)}
}
def craft_names(rand_words, snippet, pattern, caps=false)
names = snippet.scan(pattern).map do
word = rand_words.pop()
caps ? word.capitalize : word
end
return names * 2
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment