Guest User

Untitled

a guest
Feb 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. def rand_btw(low,high)
  2. srand(Time.now.to_i)
  3. loop do
  4. t = rand(high)
  5. return t if t > low
  6. end
  7. end
  8.  
  9. srand(Time.now.to_i)
  10. word_size = rand_btw(6,15)
  11. ascii_set = []
  12. word = ""
  13. i = 0
  14. loop do
  15. num = rand_btw(97,122)
  16. if ascii_set.include?(num) then next else ascii_set << num end
  17. word << num.chr
  18. break if i > word_size
  19. i += 1
  20. end
  21.  
  22. p word
Add Comment
Please, Sign In to add comment