-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmap.h
More file actions
32 lines (28 loc) · 982 Bytes
/
Copy pathmap.h
File metadata and controls
32 lines (28 loc) · 982 Bytes
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
/* map.h - 16x16 grid. 1 = wall, 0 = empty.*/
#ifndef MAP_H_INCLUDED
#define MAP_H_INCLUDED
#define MAP_W 16
#define MAP_H 16
static const unsigned char g_map[MAP_H][MAP_W] = {
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,1,1,0,1,1,1,0,0,1,0,0,0,0,1},
{1,0,1,0,0,0,0,1,0,0,1,0,1,1,0,1},
{1,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1},
{1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1},
{1,0,1,1,1,0,0,0,0,0,1,1,1,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,1,0,1,0,0,0,1,1,1,0,1,0,1,1},
{1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,1},
{1,0,1,1,1,0,1,1,1,0,0,0,1,0,0,1},
{1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1},
{1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
};
static inline int map_at(int x, int y) {
if (x < 0 || y < 0 || x >= MAP_W || y >= MAP_H) return 1; /* OOB = wall */
return g_map[y][x];
}
#endif /* MAP_H_INCLUDED */