From a756913a7134c207a7d29a1175a428b02f61b777 Mon Sep 17 00:00:00 2001 From: kartofen Date: Thu, 11 Aug 2022 23:12:12 +0300 Subject: minor bug fixes --- src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 5c32c13..6b70536 100644 --- a/src/main.c +++ b/src/main.c @@ -25,7 +25,7 @@ size_t SCALE = 9; int get_least_entropy_index() { // array of indexes with the least entropy - int least_entpy[TILEMAP_CAP]; + size_t least_entpy[TILEMAP_CAP]; size_t least_entpy_sz = 0; for(size_t i = 0; i < SHEIGHT; i++) @@ -43,6 +43,7 @@ int get_least_entropy_index() size_t l1s = count_entropy(least_entpy[least_entpy_sz-1]); if(b1s == l1s) { + if(least_entpy_sz >= TILEMAP_CAP) exit(69); least_entpy[least_entpy_sz++] = index; } else if(b1s < l1s) { least_entpy[0] = index; -- cgit v1.2.3