Mixed random numbers with letters [REPP ++]
#2

pawn Код:
randomstr(string[], maxlength = sizeof (string))
{
    string[0] = EOS;
    for (new i; i < maxlength; i++)
            format(string, maxlength, "%s%c", string, (random(((126 - 33) + 1)) + 33));
    return 1;
}
Testing:
pawn Код:
main()
{
    new test[15];
    randomstr(test);
    print(test); // Result: "aO;@}_)02BDoGn"
}
Reply


Messages In This Thread
Mixed random numbers with letters [REPP ++] - by ThatFag - 19.08.2016, 22:10
Re: Mixed random numbers with letters [REPP ++] - by Gammix - 19.08.2016, 22:29
Re: Mixed random numbers with letters [REPP ++] - by iLearner - 19.08.2016, 22:33
Re: Mixed random numbers with letters [REPP ++] - by ThatFag - 19.08.2016, 22:34
Re: Mixed random numbers with letters [REPP ++] - by Gammix - 19.08.2016, 22:44
Re: Mixed random numbers with letters [REPP ++] - by ThatFag - 19.08.2016, 22:49
Re: Mixed random numbers with letters [REPP ++] - by ThatFag - 19.08.2016, 23:02
Re: Mixed random numbers with letters [REPP ++] - by SickAttack - 19.08.2016, 23:03
Re: Mixed random numbers with letters [REPP ++] - by ThatFag - 19.08.2016, 23:06
Re: Mixed random numbers with letters [REPP ++] - by SickAttack - 19.08.2016, 23:23

Forum Jump:


Users browsing this thread: 1 Guest(s)