aboutsummaryrefslogtreecommitdiff
path: root/2020/3
diff options
context:
space:
mode:
authorMarvin Borner2020-12-08 20:56:10 +0100
committerMarvin Borner2020-12-08 20:56:29 +0100
commita48df2144386d4779aaa73fcaaa46bcc66c79c4d (patch)
treecf5fbac2c35ee6939b750e8a9bc36d17c065b7bc /2020/3
parentc3071578cfe3f97cfda05372ff2da64474a9d0c1 (diff)
Fixed naming for 10+ challenges
Diffstat (limited to '2020/3')
-rw-r--r--2020/3/Makefile10
-rw-r--r--2020/3/input323
-rw-r--r--2020/3/solve.c57
3 files changed, 0 insertions, 390 deletions
diff --git a/2020/3/Makefile b/2020/3/Makefile
deleted file mode 100644
index 769d06d..0000000
--- a/2020/3/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-.PHONY: solve.c
-
-solve.o: solve.c
- @gcc $+ -o $@
-
-clean:
- @rm -f *.o
-
-run: solve.o
- @./solve.o
diff --git a/2020/3/input b/2020/3/input
deleted file mode 100644
index 86ee0e3..0000000
--- a/2020/3/input
+++ /dev/null
@@ -1,323 +0,0 @@
-.#......##..#.....#....#.#.#...
-.#.#...#.##.#..........#...##..
-.........#.....#.####........#.
-.......#.#...#.#...............
-..#....#...#.#...#.#...#.#.....
-...#...........#..#.........#.#
-....#..#....#..#..#.#...#..##..
-#...........#..#.....#.......#.
-#..#...#...#.###...#...#.#...#.
-#...#.#.......#...#...#...##.##
-..#..................#.#.#....#
-..#.##....#........##..........
-.....#....#....#.#.......#.....
-##.#..##.#.....###.......#.....
-......#...###....#..#.#...#....
-..............#.........#.##...
-#......#.............#....#...#
-.#..#......#.###....#...#.....#
-..#........#.....#.....#...#..#
-.......#...#..............#..#.
-..#...#........#...##........#.
-.#........#....#......#......#.
-....#..#.###.......##....#.#..#
-..#..###..#....................
-......#...#....#.........#.#...
-....#.##................#..#...
-....#......######.....#........
-.#......##.......#....#..##.###
-..#...##.###..#.......#....#...
-....#.###...#.#.#........#.....
-...###...#.......#..........#.#
-..........#...#..........##.#..
-..#....#........#.....#....#..#
-..#...#.#....##..#...##....#...
-........##...#..##.....#.......
-###.......#.#...#...#.......#.#
-....#.#....##.###........#.....
-.....#..............#....##..##
-#......#.#....#.#......#.....##
-.....#....#..#......#...#......
-..#.##..#.....#..#....#......#.
-.....#.#.#..........##....#....
-.........#..#..........#.#.....
-.##..#...#......#.#..#....#....
-#.#..##.......#.#......##......
-..#.#....#.#.....#.............
-.#.........#.......#..#.#......
-##.........#..##.#......#......
-#..#.....#...#.....#.........#.
-..........#..##..##.#..##...###
-..##.....#...#..##...##.#.#....
-..#..........#.#.....##.#....#.
-.##..#..#.........###.......#..
-......##....#...##....##.......
-.....#.#.##...............#....
-#..#......#.....#..#..#.#.....#
-.....##.#....#.#.....#.#.#.....
-....#..#.#..##....#.....#....#.
-#...#.....#....#....#.#.#......
-.....#................#.......#
-.......#..#.#...#.#......#..#.#
-...........#....#....###...#.#.
-#.##....##..###.#.#......#.##.#
-..##...#.#..#..#...#.....#.#.#.
-#.....###.#..#.#...#.#......#.#
-..##.#...#...#.#.....#.#.......
-#....#...#.##......#.#......#..
-..#.....##.....#...............
-.....###...##.#...........#....
-...#..##.....##....#...........
-.....#..#......#..........#....
-....##..##.#...#...#.#.....#.##
-.#.....###..###.#...#.#..#....#
-.#..........#...#..#.#.#..#...#
-.##.##..#..#....#....####......
-....#..#.#..........#..........
-###...#.#..#..#...#..###.......
-####.#...#....#..#...#..#......
-.....##....#.#...#....##....##.
-....#.#.##....#.##..#....#.#.#.
-#......#..#.###....#####.##....
-..##..#.#.#..#........##.##..##
-#.#...#..#..#......#..#.....#..
-.###.....#.#....#.#..##.....#.#
-....#......#.#...#...#.#....#.#
-.....#.###.##..................
-.#..........#........#.#...##.#
-.##......#.#.#..#....##.###..#.
-..#.##....#....#.........#.#..#
-........#..#..#.#.####.....##..
-#..#.##.#......#.#..##.#...#..#
-..#.#.##..#.##..........#......
-##.#.....#.#.##..#..##.....##.#
-.##........#..#.....#...#.##.##
-...#....#.#.#.........##.....#.
-...#....#.#....#...#..#........
-.....#...#..#...#.##......##...
-##.........#......#..........##
-.#......#.....##....#.#.#.....#
-..#.###......#..#.#....#.....#.
-.#.......#...#...#.#.#.#..##...
-...#..............#...###.....#
-...##......#.#..#.#........#.#.
-..##.#....#..........##...#.#..
-..#...#.....#.######...##...#..
-#...#...#............#.....#...
-.###..###.##..#.........#......
-.#........##..#....#...#.#..##.
-#.#.##.#.#...###...............
-..#.#.#......#.#.#....#.....#.#
-.#...........#.##.#..#.###.....
-.###.#....#...........##.#.#...
-.#...#...........#..##.........
-.#...#.#...........#..###....#.
-.##.......#.....#.....##....#..
-#.......#........#...##.##..#.#
-....#..###..#.....##.......#...
-......###.#...#..#....#.#...#..
-..#..#.......##...#.#.#...#....
-......#..#.......#.......##.#..
-#.#....###.....#...#..#...#....
-#...#.##.#........#..........##
-.....#.#.##.#.#..#..##.......##
-.#.#.......##....#.#...........
-#..##.............##...#.#..#..
-#...........#.#......#.##.##..#
-...#...#...........#....###.#.#
-.##..#.#.#....#....#####.......
-..#...#.....#.#....#...........
-.#..#........#.....#.#......#..
-.#.........#...#...#.#.#..#....
-.##.##......#.#...#.......#...#
-.##...#..#..........#...#.....#
-#..........#..#...#.#......#...
-....##......#...##..##..#....#.
-.##.......#...#.#..##..#..#....
-.#.#................#....#.....
-..#..#..###.......#............
-...##.....#..#......#....#.....
-....#...###...#....#..##...#.#.
-#.........#.......#...#....#...
-.#.#...#.#....##....#.#..##.#..
-...#..#..#....#..#.#..##.....##
-..#..#.#.#....#...#....#..#....
-......###.....#...##.#..#.#...#
-.#.#.#..#.##........#.#....#...
-.#..........#....#.#.......#...
-#.....#........#........#....#.
-.#.#..#...#...................#
-....####..#..#..#..#....#..#.#.
-..##.#..........#.##..#.....##.
-..................##..........#
-....##....###.....#..#...#.#...
-.##.........#..#...............
-....##..###....#.##............
-#.#...###.#..##...#...........#
-.....#..#......#.....#.........
-..#..##...#.....#.....#.#......
-......#....###.#..#.#.#....#..#
-#...#.......#.##.....#.........
-.#.#..#...#.............##.....
-......#..............#.....#..#
-......#......###....#...#......
-.....#.....#...#.......###.....
-#..........##......##.#.#.....#
-....#.......#..#......#.......#
-..#...#.###...........#..#.###.
-.....#...#.#...........#.#...##
-........#.#.#........#.#.....#.
-....##..##.#.#..#.#....#.#.##..
-..#.#.#......##.....#...#.#...#
-##...#..#......#.#.#..#...#....
-....#..##...........#..#..#..#.
-.#..##...#...#...##.#..#.#....#
-.#.....####.#..#..#....##..#.#.
-.#....#..#......#.....#.#.#....
-....#..#.....#......#..........
-..#.#..###.....#...#...#.....##
-..#.#...##..#...........####...
-.#.##....##.#......#.....##.#..
-#.##..#....#.###..........##...
-.###...#......#.#....##........
-...................#..#.....#..
-#.#...#.#..#.....#...#..####.##
-....#.##..##...##.##.....#.....
-.#...#.##...........#.......##.
-###..#.....##...#.........##...
-.###....##...###...............
-.#....#####........#.#.#.##....
-.#.#....####.##........#.......
-.....#......#..................
-......###.....##......#..##.#..
-....#.#...........##.#....##.#.
-...................#.#.#.......
-#.#.#........#..#.......##.....
-..#...#...#....#......#....##.#
-#..#..............#......#....#
-......#.........##.............
-.....#.#....##..#.......#......
-......#.......#...........#....
-....#....#.#..##.#....#...#....
-#.#.#..#..#.#.#.#...#....#....#
-.#.#....#...#.#..#......#.....#
-.#...........#.#....##.....#...
-........#...#....#....##.....##
-#..#..........#..#..#.....#....
-#.#.###..........#.##....#...##
-..#................#.##.##.....
-..#...#.##...##...#.........#..
-#....#......#......#.........#.
-##...#...##.#.........#......#.
-.......#.....#.................
-...#...#.....##.........#.#..#.
-..#......#...#.......#......#.#
-#.......#...#.##.#..##..#......
-.#.#............#...###..#.....
-...#.......##.......#....#..#..
-.....#..#.#....#.#.............
-#....#...##.##....#....##......
-........#......#.......#....#..
-..#..#..##......##.#..#.#..##..
-....##......#.##.##......#.....
-........##.#...#.....#.......#.
-..##.#....#..#......#.##.......
-..##.####.#...#.#....#.........
-.#........#.....#..#....#...#.#
-###....##......#..#..#.##..#...
-..........###.#..#..#....#.....
-..#.........#....#.....#....#.#
-.#...#.#.....##.#...#...#.#..#.
-....##......##.##.#.....#..#...
-....#.##...##.......#..##......
-#..........#..#....#.......#.#.
-..#.....#.................#....
-..........#.#.#.....#.#....#..#
-.......#..........#.##....#....
-#..#.....#.......#........#....
-#.....##..#.........##..#..#.#.
-.##.#...#..........#....#......
-....#..#.#......#.##..#..#.##..
-...##.####....#.....#.#...##...
-..#.#....#.#........#..........
-#...#.#.##.##....##..#...#...#.
-...#.#.......#..#...#..#..##..#
-.....#....#........###.....#...
-.......#..#.##....#.#.....#....
-....##....#....#.......#.....#.
-.........#........###...##.....
-#.#..#...##.........#.#..#....#
-...##...........#.........#...#
-......#.#.#.........#..#.#.#...
-........##.###....#..#.......#.
-....#.#...#......#..#........##
-.#....##....#...#.##.........#.
-####.#..#...........##.#.#.....
-...#....#..#.....#..##.####.#..
-.##...#...........#.#.........#
-#.#..#..#...#.#.#.........#..#.
-#......###............#...#....
-..#.......#....#...#...#..#...#
-#.#.#...##..#...#...#.......##.
-......#.#.......#..........#.#.
-...............#...#..#...#.#..
-.#.#...##.####..##.##....#..##.
-#..####.......##.#........#...#
-......###....##...#.#..#.##....
-.##.....###..#...#.###.###.....
-..#...#.....#...#..#..##..#....
-...#...##.....##........#.#.##.
-.#...#..#....#....#..###....#.#
-..#.#.#.#.#..........#.#..#..##
-.......###.....................
-##.#......#.##.....#.........#.
-......................#.#.....#
-#..#........##.......#..##..#.#
-#.#.#.....##.#.##.##.#....##...
-.#...#.....#.........#.....#...
-..#.........#.##.#.###.#......#
-.........#..#.##...#.......###.
-.....##........#......#........
-...#.#...##...#........#.##....
-.........##............#.####..
-#....#...#...#..#....#..#.#.#.#
-..#.........#......#.##........
-....#.....#........#........#.#
-.##.#..#.#..#..###......###....
-#.###.....#.#.#.##........#..##
-#.#..#...##.....#....#...#.#...
-......#....#.....#...#.........
-...#........##.......#.##..####
-..#..#....#....#..#..#...#.##..
-.##.....#............#...#.....
-......#.......#.....#...#.#.#..
-.........#.....#...##..........
-.....#........##...........#...
-#.#..##.#...#....#....#........
-#.##..#.#.......#...#......#...
-...........#.#..#..#.....##.#..
-#....#.##.......#......#.##..#.
-.....#........#.##.#...#.....#.
-.....###..#.......##...........
-.........#.#.#.....#.##.......#
-.......#....#......#.#.....#...
-##........#...#..#.#.........#.
-##...........#.##...##......#..
-..#.###.#.#.#...####..#....###.
-.........#...#.....##....#.#.##
-.###..###.#.#.....#.##.........
-#..#...#.#.................##.#
-##.........#.#....#.#...#.###..
-#.#....#..............#.##.#...
-...#..#....##.#..#.......#..##.
-.#..#.###......##..........#..#
-.##....#.#....#....#.#..#......
-.......#.....#..#....#.##...#..
-#.#.#.........###..#..#.....#..
-...##..##...##....#..#......#..
-..........#....#..........#....
-#..##..#...#......#.....#.#....
-#..##..#....#.#.#...#..........
-......##..#.........#........#.
-.##..#..#......###.....#..#....
-.....#..#.##..........#.#..#...
diff --git a/2020/3/solve.c b/2020/3/solve.c
deleted file mode 100644
index 2f6312b..0000000
--- a/2020/3/solve.c
+++ /dev/null
@@ -1,57 +0,0 @@
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-int part_one(FILE *fp)
-{
- int res = 0;
-
- char *line = NULL;
- size_t len = 0, strlen = 0;
- int curr = 0;
- while ((strlen = getline(&line, &len, fp)) != -1) {
- if (line[curr % (strlen - 1)] == '#')
- res++;
- curr += 3;
- }
-
- return res;
-}
-
-#define DOWN_TWO (1 << 15)
-int part_two(FILE *fp)
-{
- int final = 1;
- int opt[] = { 1, 3, 5, 7, 1 | DOWN_TWO };
-
- char *line = NULL;
- size_t len = 0, strlen = 0;
- for (int i = 0; i < sizeof(opt) / sizeof(opt[0]); i++) {
- int res = 0, row = 0, curr = 0;
- while ((strlen = getline(&line, &len, fp)) != -1) {
- if (row++ % 2 == 1 && opt[i] & DOWN_TWO)
- continue;
- if (line[curr % (strlen - 1)] == '#')
- res++;
- curr += opt[i] & ~DOWN_TWO;
- }
- rewind(fp);
- final *= res;
- }
-
- return final;
-}
-
-int main(int argc, char *argv[])
-{
- FILE *fp = fopen("input", "r");
- if (!fp)
- exit(EXIT_FAILURE);
-
- printf("%d\n", part_one(fp));
- rewind(fp);
- printf("%u\n", part_two(fp));
-
- fclose(fp);
- return 0;
-}