From 6577467c897d79a6bd2b19ddde2dd12eaef6f228 Mon Sep 17 00:00:00 2001 From: TannerRobison Date: Mon, 13 Jul 2026 06:34:43 +0000 Subject: Update LICENSE --- abellian_sandpile.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'abellian_sandpile.c') diff --git a/abellian_sandpile.c b/abellian_sandpile.c index 5293cae..321f53a 100644 --- a/abellian_sandpile.c +++ b/abellian_sandpile.c @@ -60,15 +60,18 @@ int main() { fprintf(stderr, "Failed to initialize grid"); } - uint32_t time_steps = 4000000000; //4 billion time steps - for (int i = 0; i < time_steps; i++) { + uint8_t render_count = 100; //100 renders + uint32_t render_gap = 100000; //renders every 100k time steps + for (uint8_t i = 0; i < render_count; i++) { // drop a 'grain' of sand of top of sandpile - for (int j = 0; j < 100000; j++) { + for (uint32_t j = 0; j < render_gap; j++) { positions[terminal_height / 2][terminal_width / 2] += 1; get_new_positions(terminal_height, terminal_width, positions, new_positions); } - printf("time step: %u", (unsigned int)time_steps); + uint64_t current_step = (uint32_t)i * render_gap; + printf("time step: %u", (unsigned int)current_step); + printf(CLEAR_GRID); render(terminal_height, terminal_width, positions, new_positions); } -- cgit v1.2.3