Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dict = File.open('/path/to/dictionary.file')
- lines = dict.readlines
- if ARGV[0] != nil
- number_of_words = ARGV[0]
- else
- number_of_words = 1
- end
- words = []
- (1..number_of_words.to_i).each do |word|
- words << lines[rand(lines.size)].rstrip
- end
- puts words.join(" ")
Add Comment
Please, Sign In to add comment