summaryrefslogtreecommitdiff
path: root/abellian_sandpile.c
diff options
context:
space:
mode:
authorTanner Robison <[email protected]>2026-07-16 20:38:37 -0700
committerTanner Robison <[email protected]>2026-07-17 10:50:04 -0700
commit250d8132dd23cb5ef419960d765335ce2ade9135 (patch)
tree2885f77ee8a480a31a66674dc77998382bbcef62 /abellian_sandpile.c
parent7d15e964fefe8cb7cc954c367b1128e75fa6a888 (diff)
updated README & integer size
Diffstat (limited to 'abellian_sandpile.c')
-rw-r--r--abellian_sandpile.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/abellian_sandpile.c b/abellian_sandpile.c
index 143fa0e..7d9f34b 100644
--- a/abellian_sandpile.c
+++ b/abellian_sandpile.c
@@ -6,12 +6,6 @@
#include <sys/ioctl.h>
#include <unistd.h>
-#define CLEAR_GRID "\033[1;1H\033[2J"
-#define COLOR_RED "\033[31m" // cell value 4
-#define COLOR_ORANGE "\033[31m" // cell value 3
-#define COLOR_YELLOW "\033[33m" // cell value 2
-#define COLOR_WHITE "\033[37m" // cell value 1
-
#define COLOR_DARK_BLUE "\033[38;5;19m" // cell value 4 (Dark Blue)
#define COLOR_MED_BLUE "\033[38;5;33m" // cell value 3 (Medium Blue)
#define COLOR_LIGHT_BLUE "\033[38;5;81m" // cell value 2 (Light Blue)
@@ -65,16 +59,16 @@ int main() {
fprintf(stderr, "Failed to initialize grid");
}
- uint8_t render_count = 100; //100 renders
+ uint32_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++) {
+ for (uint32_t i = 0; i < render_count; i++) {
// drop a 'grain' of sand of top of sandpile
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);
}
- uint64_t current_step = (uint32_t)i * render_gap;
+ uint64_t current_step = i * render_gap;
printf("time step: %u", (unsigned int)current_step);
printf(CLEAR_GRID);