aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2022-08-11 23:12:12 +0300
committerkartofen <mladenovnasko0@gmail.com>2022-08-11 23:12:12 +0300
commita756913a7134c207a7d29a1175a428b02f61b777 (patch)
treef462a6b9f5a324467973800c6315e3cd2b37e20f /src/main.c
parent89a48fc3e7252e1c7941f86559ca00b38d525244 (diff)
minor bug fixes
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c3
1 files changed, 2 insertions, 1 deletions
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;