diff options
| author | emmadoth <emmadoth@disroot.org> | 2023-05-09 02:07:52 +0200 |
|---|---|---|
| committer | emmadoth <emmadoth@disroot.org> | 2023-05-09 02:07:52 +0200 |
| commit | b750c0127fb5040d7c641ef9f2147fee807d304a (patch) | |
| tree | fcd2e15c32f8a8f51d239e2d166e4da9b7078435 /main.c | |
| parent | c4d2a0f2c7d3bfafb952ac6f59857dbbbd708a92 (diff) | |
+= 1 -> ++
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -26,21 +26,21 @@ void get_neighbours(F_ARGS) { if(y > 0) { - if(board[y - 1][x]) neighbours[y][x] += 1; // n + if(board[y - 1][x]) ++neighbours[y][x]; // n - if((x + 1) < size->width && board[y - 1][x + 1]) neighbours[y][x] += 1; // ne - if( x > 0 && board[y - 1][x - 1]) neighbours[y][x] += 1; // nw + if((x + 1) < size->width && board[y - 1][x + 1]) ++neighbours[y][x]; // ne + if( x > 0 && board[y - 1][x - 1]) ++neighbours[y][x]; // nw } - if((x + 1) < size->width && board[y][x + 1]) neighbours[y][x] += 1; // e - if( x > 0 && board[y][x - 1]) neighbours[y][x] += 1; // w + if((x + 1) < size->width && board[y][x + 1]) ++neighbours[y][x]; // e + if( x > 0 && board[y][x - 1]) ++neighbours[y][x]; // w if((y + 1) < size->height) { - if(board[y + 1][x]) neighbours[y][x] += 1; // s + if(board[y + 1][x]) ++neighbours[y][x]; // s - if((x + 1) < size->height && board[y + 1][x + 1]) neighbours[y][x] += 1; // se - if( x > 0 && board[y + 1][x - 1]) neighbours[y][x] += 1; // sw + if((x + 1) < size->height && board[y + 1][x + 1]) ++neighbours[y][x]; // se + if( x > 0 && board[y + 1][x - 1]) ++neighbours[y][x]; // sw } } |
