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: Sage Master Sage 2009-12-10 16:10

>>40
Tip: Do your own fucking homework.

Name: Anonymous 2009-12-10 16:15

>>1
You didn't explain any other part of the program, so who knows or cares what's wrong.

Name: Anonymous 2009-12-10 16:18

>>24
actually in already answered it in >>7

Name: Anonymous 2009-12-10 17:07

>>43
In >>7 you're implying creating a new board for each generations, so that the memory cost of your solution is O(n). My proposition in >>24 has a memory cost of O(1).

Name: Anonymous 2009-12-10 17:15

>>44
If you discard the boards when you are finished with them, they should be functionally equivalent. Later, if you wanted to, for example, play back the game, then >>7s solution is better. For a simple first go, I'd double buffer, as you suggested.

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