01.05.2012, 19:51
Well you could do something like this:
pawn Код:
new originalstring[size]; // originalstring contains the string to be scrambled
new scrambledstring[size]; // this will contain the scrambled string
new rand;
for(new i = 0, j = strlen(originalstring); i != j; i++)
{
do
{
rand = random(j);
}
while(scrambledstring[rand] != 0);
scrambledstring[rand] = originalstring[i];
}