PDA

View Full Version : String factorial (length 24)


DarkPower
28/12/2012, 04:15 PM
How to make for loop for all possible allowed NICK characters length of 24 characters

So, first for loop will do with lenght of 3 characters, beacuse NICK in samp must be 3+ characters and for loop will print all possible ways of that characters

ABC
ACB
BAC
BCA
CAB
CBA

and then will do same think with 4 characters, in example i use JUST A B C but how to make with HOLE alphabet and numbers too?

Andrei0427
28/12/2012, 04:17 PM
CABCA

Grim_
28/12/2012, 04:18 PM
I cannot think of a reason you would need this. It would also take VERY LONG to actually do this operation. So if you give us the 'why' behind you wanting to do this, we can give a healthy alternative.

dr.lozer
28/12/2012, 04:21 PM
Just STFU and use new string[128];

and BTW who the hell want to use only 3 or 4 ???

DarkPower
28/12/2012, 04:22 PM
Yes i know it will take VERY VERY LONG, i wanna that because i use .ini file system saving and i have about 2,000 users in folder and with this alogirm that i ask for i can check how much registred account's i have with EVRY way that alogirtm give i can use

if(fexist(...))
{
printf("ACCOUNT ID: %i", ...);
}

and other thinks like, loop throudh hole user folder :)
i know it not best way to do it but idk how i can make that without this method

Grim_
28/12/2012, 04:55 PM
A much better solution would to be create another file that holds a single value, and increment that value each time someone registers. That way, when you need to know how many accounts there are, just open that one file and read the value.

DarkPower
28/12/2012, 04:59 PM
I think about that already, tny but i just wanna loop once that folder and i think this solution is best never mind how long it takes that i get results... I need that algoritm

DarkPower
28/12/2012, 05:05 PM
Thanks ******, wow that is too long
I think i will start with switching my gamemode on mySQL but i will try with y_users and with file plugin :)