Skip to content

Commit 1975592

Browse files
committed
Add day 11a, day 11b
1 parent 72ae5d7 commit 1975592

File tree

19 files changed

+1170
-29
lines changed

19 files changed

+1170
-29
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.txt text eol=lf
22
*.csv text eol=lf linguist-detectable
33
*.sh text eol=lf
4+
include/** linguist-vendored

Makefile

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ all: \
77
intcode \
88
day02a day02b \
99
day07a day07b \
10-
day09b \
11-
day10a \
1210
day11a day11b \
1311
day12a day12b \
1412
day13a day13b \
@@ -34,11 +32,17 @@ emulate: tools/emulate.c emulator parser
3432
$(CC) $(CFLAGS) $< -o emulate.o emulator.o parser.o
3533

3634
intcode: tools/intcode.c emulator parser
37-
$(CC) $(CFLAGS) $< -o intcode.o emulator.o parser.o
35+
$(CC) $(CFLAGS) $< -o intcode.o emulator.o parser.o -Wno-unused-parameter
3836

3937
permutation_iterator: lib/permutation_iterator.h lib/permutation_iterator.c
4038
$(CC) $(CFLAGS) -c lib/permutation_iterator.c -o permutation_iterator.o
4139

40+
qdbmp: include/qdbmp.h include/qdbmp.c -Wno-type-limits
41+
$(CC) $(CFLAGS) -c include/qdbmp.c -o qdbmp.o
42+
43+
bitmap: lib/bitmap.h lib/bitmap.c qdbmp
44+
$(CC) $(CFLAGS) -c lib/bitmap.c -o bitmap.o
45+
4246
day02a: src/day02a.c emulator parser
4347
$(CC) $(CFLAGS) $< -o $@.o emulator.o parser.o
4448

@@ -51,17 +55,11 @@ day07a: src/day07a.c emulator parser permutation_iterator
5155
day07b: src/day07b.c emulator parser permutation_iterator
5256
$(CC) $(CFLAGS) $< -o $@.o emulator.o parser.o permutation_iterator.o
5357

54-
day09b: src/day09b.c
55-
$(CC) $(CFLAGS) $< -o $@.o $(LIBM)
56-
57-
day10a: src/day10a.c
58-
$(CC) $(CFLAGS) $< -o $@.o
59-
60-
day11a: src/day11a.c
61-
$(CC) $(CFLAGS) $< -o $@.o
58+
day11a: src/day11a.c emulator parser
59+
$(CC) $(CFLAGS) $< -o $@.o emulator.o parser.o
6260

63-
day11b: src/day11b.c
64-
$(CC) $(CFLAGS) $< -o $@.o
61+
day11b: src/day11b.c emulator parser bitmap
62+
$(CC) $(CFLAGS) $< -o $@.o emulator.o parser.o qdbmp.o bitmap.o
6563

6664
day12a: src/day12a.c
6765
$(CC) $(CFLAGS) $< -o $@.o

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ complexity and running time. This repository only includes solutions to the
1111
These programs are cross-platform, having been tested on Windows and Linux
1212
operating systems.
1313

14-
**Important:** Use the `MEMORY`, `INPUTS`, and `OUTPUTS` macro to ensure that
14+
**Important:** Use the `MEMORY`, `INPUTS`, and `OUTPUTS` macros to ensure that
1515
the program does not run out of memory and invoke undefined behavior.
1616

1717
## Constraints
@@ -21,13 +21,16 @@ I am working within the following constraints to ensure high code quality.
2121
- Adhere to the [project style guide](cstyle.md).
2222
- Final solutions must be implemented in the C programming language following
2323
the C99 standard.
24-
- All solutions must be standalone files with no external dependencies beyond
25-
the C standard library (`libc`) and the C mathematics library (`libm`). The
26-
first and second problems for a given day must be implemented separately.
2724
- Bounds checking is not required for data structures whose capacity is defined
2825
by a macro.
2926
- The return values of all C standard library functions must be checked, except
3027
for those returned from the following:
3128
- `fprintf`
3229
- `memcpy`
3330
- `printf`
31+
32+
## Attribution
33+
34+
This repository redistributes
35+
[cbraudo/qdbmp](https://github.com/cbraudo/qdbmp/tree/master) (Quick \' Dirty
36+
BMP Library) by Chai Braudo. This component is required for Day 11(b) and is distributed under the MIT license.

data/011.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1101,0,11111,0,3,1,102,-1,1,1,101,1,1,1,4,1,4,1,101,-1,2,2,1005,2,4,99

0 commit comments

Comments
 (0)