Random text string?
#8

Quote:
Originally Posted by RyDeR`
View Post
pawn Code:
stock randomString(strDest[], strLen = 10)
{
    while(strLen--)
        strDest[strLen] = random(2) ? (random(26) + (random(2) ? 'a' : 'A')) : (random(10) + '0');
}
Example:
pawn Code:
new
    string[10]
;
randomString(string, 10);
string[9] = random(bla bla) = crash, must be +1

pawn Code:
new
    string[11]
;
:> string[10] = EOS
Reply


Messages In This Thread
Random text string? - by linuxthefish - 15.08.2011, 18:37
Re: Random text string? - by WoodPecker - 15.08.2011, 18:39
Re: Random text string? - by linuxthefish - 15.08.2011, 18:41
Re: Random text string? - by WoodPecker - 15.08.2011, 18:57
Re: Random text string? - by RyDeR` - 15.08.2011, 19:06
Re: Random text string? - by linuxthefish - 15.08.2011, 19:08
Re: Random text string? - by Scenario - 15.08.2011, 19:19
Re: Random text string? - by Jefff - 15.08.2011, 19:27
Re: Random text string? - by RyDeR` - 15.08.2011, 20:39
Re: Random text string? - by MadeMan - 16.08.2011, 19:08

Forum Jump:


Users browsing this thread: 4 Guest(s)