diff options
author | HampusM <hampus@hampusmat.com> | 2022-01-07 12:56:37 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-01-07 12:56:37 +0100 |
commit | 977c46591583a59f8d51773ffaba08b5076a426e (patch) | |
tree | a04727c2075cebe0ae8b93728c9071e164a17c43 /src/maze.c | |
parent | 2876d7efdeac80085a04b8f1c509065bf323f70e (diff) |
style: fix minor code formatting issues
Diffstat (limited to 'src/maze.c')
-rw-r--r-- | src/maze.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1,10 +1,10 @@ #include "maze.h" #include "grid.h" #include "position.h" +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <stdint.h> int is_pos_empty(Grid grid, Position pos) { @@ -15,10 +15,10 @@ void add_neighbour(Position neighbours[], uint8_t *neighbour_cnt, Position neigh { neighbours[*neighbour_cnt] = neighbour_pos; (*neighbour_cnt)++; - } -void get_neighbours(Grid grid, Position pos, Position neighbours[], uint8_t *neighbour_cnt) +void get_neighbours(Grid grid, Position pos, Position neighbours[], + uint8_t *neighbour_cnt) { if (pos.y != 1) { @@ -96,7 +96,7 @@ void grid_to_maze(Grid grid, Position start_pos) Position next_pos = neighbours[rand() % neighbour_cnt]; Position between_pos = position_create(pos.x, pos.y); - + if (next_pos.y != pos.y) between_pos.y += next_pos.y > pos.y ? 1 : -1; @@ -110,4 +110,3 @@ void grid_to_maze(Grid grid, Position start_pos) pos_stack_destroy(path); } - |