View Single Post
Old 01-10-2005, 12:01 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
Your 'i' will only have a value of 0, the first time the outer loop is run, in the example on the page, it is initiated to 0 on each run.
Code:
/* n is a straight up integer */
j = 0;
while(n) {
      i = 0;
      do {
            j = ( j + state[i] + state2[i] );
            x = state[i];
            state[i] = state[j];
            state[j] = x;
            i++;
      } while (i);
      n--;
}
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is online now   Reply With Quote