Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Game of dicks

Name: Anonymous 2009-12-06 13:11


live() {
 for(int i = 0; i < w; i++) {
 for(int j = 0; j < h; j++) {
  n[i][j] = neighbours(i,j);
  board[i][j] =
   board[i][j]
    ? (n[i][j] == 2 || n[i][j] == 2)
    : (n[i][j] == 3)
 }
 }


motherfuckers, I can't get my game of life working. Help me you assholes. live is meant to do one iteration but it's fucked up somehow.

Name: Anonymous 2009-12-06 13:30

I'm going to assume that w, h, and n are defined outside of this function.

"board[i][j] =
"   board[i][j]
"    ? (n[i][j] == 2 || n[i][j] == 2)
"    : (n[i][j] == 3)"
I know what you're trying to do, but I have no clue what you're doing.  I'm assuming that board is boolean, so then why are you assigning the value of 2 or 3 to it?  And what's with that || in the THEN position?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List