aboutsummaryrefslogtreecommitdiff
path: root/src/maze.h
blob: 5b3581a85ef682b75406601d6f2ae8e8487cfd50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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