summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonsykkel <jonrevold@gmail.com>2020-10-26 23:38:30 +0100
committerjonsykkel <jonrevold@gmail.com>2020-10-26 23:38:30 +0100
commit384a08dd03ed48143eab0c2e676e52b91fcfac28 (patch)
treef7e09a275f9de6f860b56affbde5d399d8be8066
parentc9ca24e0ee5d70e026c86fe72885ad31d30f7250 (diff)
downloadmindustry_solver-384a08dd03ed48143eab0c2e676e52b91fcfac28.tar.gz
-rw-r--r--src/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 71c1ea7..c585b45 100644
--- a/src/main.c
+++ b/src/main.c
@@ -97,6 +97,7 @@ static void map_alloc(map_t *map,size_t width,size_t height,char const *init){
for(size_t y = 0;y < map->height;y++) cell_init(MAP_CELL(map,map->width-1,y ),' ');
drill_max = (map->width/DRILL_DIM_MIN)*(map->height/DRILL_DIM_MIN);
map->drill = malloc(sizeof(drill_t)*drill_max);
+ if(!map->drill) fail();
map->drill_cnt = 0;
map->ore_cnt = 0;
}
@@ -280,6 +281,7 @@ int main(int argc,char **argv){
" oooooooooo "
" ooooo ");
+ /*
map_alloc(&map,10,10, "oooooooooo"
"oooooooooo"
"oooooooooo"
@@ -290,8 +292,9 @@ int main(int argc,char **argv){
"oooooooooo"
"oooooooooo"
"oooooooooo");
+ */
- while(map_drill_auto(&map,3));
+ while(map_drill_auto(&map,2));
map_print(&map);
printf("drils total %zu\n",map.drill_cnt);
printf("ore total %zu\n",map.ore_cnt);