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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#include <stdio.h>
#include <sys/stat.h>
#include "ppm.h"
int tile_0[9] = {
0, 0, 0,
0, 0, 0,
0, 0, 0
};
int tile_1[9] = {
0, 1, 0,
1, 1, 1,
0, 0, 0
};
int tile_2[9] = {
0, 1, 0,
0, 1, 1,
0, 1, 0
};
int tile_3[9] = {
0, 1, 0,
1, 1, 0,
0, 1, 0
};
int tile_4[9] = {
0, 0, 0,
1, 1, 1,
0, 1, 0
};
int tile_5[9] = {
0, 1, 0,
1, 1, 1,
0, 1, 0
};
void gen()
{
mkdir("files/", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
save_as_ppm("files/tile_0.ppm", tile_0, 3, 3, 1);
save_as_ppm("files/tile_1.ppm", tile_1, 3, 3, 1);
save_as_ppm("files/tile_2.ppm", tile_2, 3, 3, 1);
save_as_ppm("files/tile_3.ppm", tile_3, 3, 3, 1);
save_as_ppm("files/tile_4.ppm", tile_4, 3, 3, 1);
save_as_ppm("files/tile_5.ppm", tile_5, 3, 3, 1);
}
int main(void)
{
gen();
return 0;
}
|