Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def rand_btw(low,high)
- srand(Time.now.to_i)
- loop do
- t = rand(high)
- return t if t > low
- end
- end
- srand(Time.now.to_i)
- word_size = rand_btw(6,15)
- ascii_set = []
- word = ""
- i = 0
- loop do
- num = rand_btw(97,122)
- if ascii_set.include?(num) then next else ascii_set << num end
- word << num.chr
- break if i > word_size
- i += 1
- end
- p word
Add Comment
Please, Sign In to add comment