diff options
| author | Sopár Adrián <adrian.sopar@protonmail.com> | 2024-06-20 09:28:14 +0200 |
|---|---|---|
| committer | Sopár Adrián <adrian.sopar@protonmail.com> | 2024-06-20 09:28:14 +0200 |
| commit | 74ea6dc86646cee9915292d73d8c7afef01ef3e0 (patch) | |
| tree | 9a58866f7765dad8ba56f1f40b1fa031e9d2687d /src/maze.h | |
First commit. This is mostly the state of the project as I left it around the end of 2019.HEADmaster
Diffstat (limited to 'src/maze.h')
| -rw-r--r-- | src/maze.h | 32 |
1 files changed, 32 insertions, 0 deletions
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 |
