Word Scrambling
#7

pawn Код:
stock Scramble(string[], size=sizeof(string))
{
    new rand, tmp;
    for(new i=0; i < size; ++i) if(string[i] == ' ' || string[i] == '\0') size=i-1;
   
    for(new i=0; i < size; ++i)
    {
        rand=random(size);
        tmp=string[i];
        string[i]=string[rand];
        string[rand]=tmp;
    }
    return 1;
}
Mine's probably not as optimized as yours though, but was making sure was only 1 word gettin scrambled lol
Reply


Messages In This Thread
Word Scrambling - by venomlivno8 - 06.04.2013, 18:44
Re: Word Scrambling - by MP2 - 06.04.2013, 18:57
Re: Word Scrambling - by Pottus - 06.04.2013, 18:59
Re: Word Scrambling - by [ABK]Antonio - 06.04.2013, 19:04
Re: Word Scrambling - by Pottus - 06.04.2013, 19:05
Re: Word Scrambling - by MattyG - 06.04.2013, 19:06
Re: Word Scrambling - by [ABK]Antonio - 06.04.2013, 19:06
Re: Word Scrambling - by Pottus - 06.04.2013, 19:11
Re: Word Scrambling - by venomlivno8 - 06.04.2013, 20:26

Forum Jump:


Users browsing this thread: 1 Guest(s)