Hi every one,
I’m trying to make a function that gave me a random password of 4 number and I did like that:
local function generaPW() local r = "" local elem = { "1","2","3","4","5","6","7","8","9","0" } for i=1, 4 do local rnd = math.random(#elem) r = r .. elem[rnd] end return r end pword = generaPW()
But this give me back all times (only in the device) that combination of result:
1st time I run: 1285
2nd time I run: 6317
3th time I run: 7046
4th time I run: 9116
and so go on.
Every time I kill my app and I restart it restart that combination on “random” numbers.
I use the random in an other part of my app and I notice that here too gave me the same combination of random outing.
How that is possible? It’s not really random
Regards