Weird while() loop not finishing run.
#1

pawn Код:
new ARRAY[12];


forward WhileTimer();

public WhileTimer()
{
    print("CALL TEH FUNCTION BITCH");
    new VARCOUNTDOWN;
    VARCOUNTDOWN = 12;

    while(VARCOUNTDOWN > 0)
    {
        print("LOOP HAS TEH BEEN CALLED"); // Last Print before it mysteriously stops.
        if(random(2) == 0)
        {
            print("IS IT FUCKED!?!?!?");
            new VAR;
            VAR = random(10);
            ARRAY[VARCOUNTDOWN] = ARRAY[VARCOUNTDOWN] + VAR;
            print("DEBUG MOTHERFUCKER");
           
        }
           
        else

        {
           
            new VAR2;
            new VAR3;
            VAR2 = random(10);
            VAR3 = VAR2 - VAR2 * 2;
            ARRAY[VARCOUNTDOWN] = ARRAY[VARCOUNTDOWN] + VAR3;
            print("DEBUG MOTHERFUCKER #2");
           
        }

        printf("%d : %d",VARCOUNTDOWN,ARRAY[VARCOUNTDOWN]);
        VARCOUNTDOWN--;
        print("DEBUG MOTHERFUCKER #3");
    }
   
}
It worked perfectly as a function but the While would be more efficient, Advice and help would be appreciated.
Reply


Messages In This Thread
Weird while() loop not finishing run. - by Hoborific - 18.11.2011, 13:23
Re: Weird while() loop not finishing run. - by Hoborific - 18.11.2011, 13:35

Forum Jump:


Users browsing this thread: 1 Guest(s)