random
#1

I though i will never need this feature, but now its different.

Just wondering, how could i random only 2 to 3 capital letters "ABCDEFGH" and in the result would be only 3 of them randomed order.

the same question about numbers

and how would i `format` results

And the last questions.
How could i Check if in string are atleast 2 Capital leters and some numbers.
Just asking for my custom vehicle license(or licence) plate
e.g. LK-12551, HGS-9384 etc.
Reply
#2

maybe something like:

Код:
new RandLet[][] = {
"A",
"B",
etc...
};

new RandNum[][] = {
1,
2,
3,
etc
}
Where you need it:
Код:
new place[3];
new n = random(sizeof(RandNum));
place[0] = RandNum[n];
n = random(sizeof(RandNum));
place[1] = RandNum[n];
n = random(sizeof(RandNum));
place[2] = RandNum[n];
same with letters...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)