ScrambleString(string[]).. Help please.
#8

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];
}
Reply


Messages In This Thread
ScrambleString(string[]).. Help please. - by introzen - 01.04.2012, 12:54
Re: ScrambleString(string[]).. Help please. - by steki. - 01.04.2012, 12:58
Re: ScrambleString(string[]).. Help please. - by chrism11 - 01.04.2012, 12:59
Re: ScrambleString(string[]).. Help please. - by introzen - 01.04.2012, 12:59
Re: ScrambleString(string[]).. Help please. - by introzen - 01.04.2012, 13:01
AW: ScrambleString(string[]).. Help please. - by Nero_3D - 01.04.2012, 14:32
Re: ScrambleString(string[]).. Help please. - by Lidorrr - 01.05.2012, 19:42
Re: ScrambleString(string[]).. Help please. - by Hiddos - 01.05.2012, 19:51
Re: ScrambleString(string[]).. Help please. - by mamorunl - 01.05.2012, 20:03

Forum Jump:


Users browsing this thread: 1 Guest(s)