|
| 15 Jul 2014 04:39 PM |
How would I do something like generating a random Code or something that would have some amount of Digits? like say 9 Digits of Random Numbers... cos of course I could do it manually like
TotalNumber = {}
Number1 = math.random(0, 9) etc here
and then do
table.insert(TotalNumber, Number1)
and so on... but I needa do it more efficiently (I want to know, but I dont know about using) |
|
|
| Report Abuse |
|
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
|
| 15 Jul 2014 04:41 PM |
for i=1, 9 do local num = math.random(1,9) end
~Tynexx
|
|
|
| Report Abuse |
|
|
|
| 03 Aug 2014 05:04 PM |
| oh yeah lol... thnx, wat about requirements? like 'make a Pas$word with at least 7 Digits' kind of thing |
|
|
| Report Abuse |
|
|
BlupoV2
|
  |
| Joined: 12 Nov 2012 |
| Total Posts: 543 |
|
|
| 03 Aug 2014 05:06 PM |
if string.len([STRING]) == 7 then -- Code end |
|
|
| Report Abuse |
|
|
BlupoV2
|
  |
| Joined: 12 Nov 2012 |
| Total Posts: 543 |
|
| |
|
|
| 03 Aug 2014 05:16 PM |
I looked and see... if text:len() >= 7 then I guess it's correct |
|
|
| Report Abuse |
|
|