From 74ea6dc86646cee9915292d73d8c7afef01ef3e0 Mon Sep 17 00:00:00 2001 From: Sopár Adrián Date: Thu, 20 Jun 2024 09:28:14 +0200 Subject: First commit. This is mostly the state of the project as I left it around the end of 2019. --- src/maze.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/maze.h (limited to 'src/maze.h') diff --git a/src/maze.h b/src/maze.h new file mode 100644 index 0000000..5b3581a --- /dev/null +++ b/src/maze.h @@ -0,0 +1,32 @@ +#ifndef MAZE_H +#define MAZE_H + +struct point +{ + int x; + int y; +}; + +struct maze +{ + int width; + int height; + int **map; + struct point starting_point; + struct point end_point; +}; + +static inline struct point relative_point(struct point point, int x, int y) +{ + struct point new_point; + new_point.x = point.x + x; + new_point.y = point.y + y; + return new_point; +} + +static inline int is_valid_maze_size(int size) +{ + return size > 2 && size % 2 != 0; +} + +#endif \ No newline at end of file -- cgit v1.2.3