in reply to Re^3: Particle movement question
in thread Particle movement question

I am also having trouble making sense of this structure and converting it.

/* Mark cells containing particles as fluid cells (loop over particle +s) */ /*------------------------------------------------------------------- +---*/ for (n=1;n<=N;n++) for(part=Particlelines[n].Particles; part->next != NULL; part=part +->next) { x = part->next->x; y = part->next->y; i = (int)(x/delx)+1; j = (int)(y/dely)+1; if (FLAG[i][j] < C_F) { /* delete particles in obstacle cells */ help = part->next->next; free(part->next); part->next = help; Particlelines[n].length--; } else FLAG[i][j] = FLAG[i][j] & ~C_E; }

Replies are listed 'Best First'.
Re^5: Particle movement question
by BrowserUk (Patriarch) on Apr 26, 2017 at 01:03 UTC

    Do you know what a linked list is?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
    In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit