forked from xiexun162534/Labyrinth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint.c
More file actions
36 lines (35 loc) · 790 Bytes
/
print.c
File metadata and controls
36 lines (35 loc) · 790 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
33
34
35
36
#include "print.h"
void print (map *labyrinth)
{
int i, j;
for (j = 0; j < labyrinth->height; j++)
{
for (i = 0; i < labyrinth->width; i++)
{
coordinate position;
position.x = i;
position.y = j;
switch (get_land_type (labyrinth, position))
{
case ROAD:
putchar ('R');
break;
case WALL:
putchar ('W');
break;
case LAND:
putchar ('L');
break;
case ENTRANCE:
putchar ('I');
break;
case EXIT:
putchar ('O');
break;
default:
putchar ('D');
}
}
putchar ('\n');
}
}