Answer the question
In order to leave comments, you need to log in
Why are there no multiple return values when a function is called multiple times?
There is a working function that generates a word.
function password()
local vars = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz'
local strlengths = string.len(vars)
print(strlengths)
local vars1 = ''
math.randomseed(os.time())
arrys = {}
for vars2 in vars:gmatch"." do
table.insert(arrys, vars2)
end
for i = 2, strlengths do
vars1 = vars1 .. arrys[math.random(2, #arrys)]
end
return vars1
end
list={}
for i=1,10 do
list[i]=password()
end
Answer the question
In order to leave comments, you need to log in
function password(num) ----> фикс
num = (num or 0) * 5 ----> новая логика разных слов
local vars = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz'
local strlengths = string.len(vars)
print(strlengths)
local vars1 = ''
math.randomseed(os.time() + num) ----> фикс
arrys = {}
for vars2 in vars:gmatch"." do
table.insert(arrys, vars2)
end
for i = 2, strlengths do
vars1 = vars1 .. arrys[math.random(2, #arrys)]
end
return vars1
end
list={}
for i=1,10 do
list[i]=password(i) ----> фикс
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question