@@ 32,9 32,12 @@
/* live cells = 0, dead cells = 1..255, depending how long they've been dead,
* for a fadeout effect */
-static unsigned char board[H][W], boardtmp[H][W]; char title[60]; static unsigned gen;
-static SDL_Window *win; static SDL_Renderer *ren; static bool running = 1,
- pause;
+static unsigned char board[H][W], boardtmp[H][W];
+static char title[60];
+static unsigned gen;
+static SDL_Window *win;
+static SDL_Renderer *ren;
+static bool running = 1, pause;
#define neighbours(b,y,x) \
( !b[(y-1)%H][(x-1)%W] + !b[(y-1)%H][(x)%W] + !b[(y-1)%H][(x+1)%W] \
@@ 51,7 54,7 @@ static void life(size_t i, size_t y, size_t x, size_t n, char _[(
: (board[y][x] == 0) ?
boardtmp[y][x] = 150
:
- (boardtmp[i/W][i%W] = MIN(boardtmp[i/W][i%W]*5/4, 255)),
+ (boardtmp[y][x] = MIN(boardtmp[y][x]*5/4, 255)),
(++i < W*H) ?
TAIL life(i, y,x,n,"")