Guest User

Untitled

a guest
Jul 17th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. dict = File.open('/path/to/dictionary.file')
  2. lines = dict.readlines
  3.  
  4. if ARGV[0] != nil
  5. number_of_words = ARGV[0]
  6. else
  7. number_of_words = 1
  8. end
  9.  
  10. words = []
  11.  
  12. (1..number_of_words.to_i).each do |word|
  13. words << lines[rand(lines.size)].rstrip
  14. end
  15.  
  16. puts words.join(" ")
Add Comment
Please, Sign In to add comment