From f158268a0d59133b7cef538b3fa57ece16f2981d Mon Sep 17 00:00:00 2001 From: kartofen Date: Mon, 8 Aug 2022 16:16:47 +0300 Subject: Big Bang --- src/gen_tiles.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/gen_tiles.c (limited to 'src/gen_tiles.c') diff --git a/src/gen_tiles.c b/src/gen_tiles.c new file mode 100644 index 0000000..87e50bd --- /dev/null +++ b/src/gen_tiles.c @@ -0,0 +1,49 @@ +#include +#include +#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 +}; + +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); + save_as_ppm("files/tile_1.ppm", tile_1, 3, 3); + save_as_ppm("files/tile_2.ppm", tile_2, 3, 3); + save_as_ppm("files/tile_3.ppm", tile_3, 3, 3); + save_as_ppm("files/tile_4.ppm", tile_4, 3, 3); +} + +int main(void) +{ + gen(); + return 0; +} -- cgit v1.2.3