| 52 | } |
| 53 | |
| 54 | void game(int w, int h, int i) |
| 55 | { |
| 56 | unsigned univ[h][w]; |
| 57 | //for_xy univ[y][x] = rand() < RAND_MAX / 10 ? 1 : 0; |
| 58 | int acc = 0; // nonrandom generation, for benchmarking |
| 59 | for_xy { |
| 60 | acc += (x*17) % (y*3 + 1); |
| 61 | univ[y][x] = acc & 1; |
| 62 | } |
| 63 | while (i != 0) { |
| 64 | //show(univ, w, h); |
| 65 | evolve(univ, w, h); |
| 66 | if (i > 0) { |
| 67 | i--; |
| 68 | nudge(univ, w, h); // keep it interesting for benchmark |
| 69 | } else { |
| 70 | #if !__EMSCRIPTEN__ |
| 71 | usleep(20000); |
| 72 | #endif |
| 73 | show(univ, w, h); |
| 74 | } |
| 75 | } |
| 76 | show(univ, w, h); |
| 77 | } |
| 78 | |
| 79 | int main(int argc, char **argv) |
| 80 | { |