advent2021

Advent of Code 2021 Solutions
git clone git://bsandro.tech/advent2021
Log | Files | Refs

commit 35af63181a8d7493308737dc0d8a4094a5fc0100
parent 5cb3777952b8ebf00878668998d91b0db99535ae
Author: bsandro <brian.drosan@gmail.com>
Date:   Tue,  7 Dec 2021 21:01:44 +0200

Couple of Makefile fixes (so changing the common headers would cause rebuilds too)

Diffstat:
Mday04/Makefile | 2+-
Mday05/Makefile | 2+-
Mday07/Makefile | 2+-
Mday07/puzzle.c | 2+-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/day04/Makefile b/day04/Makefile @@ -1,7 +1,7 @@ NAME=$(shell basename ${PWD}) CC=cc SRC=$(wildcard *.c) -DEPS:=$(wildcard *.h) +DEPS:=$(wildcard *.h ../common/*.h) OBJ:=$(SRC:.c=.o) CFLAGS=-O2 -std=c99 -Werror -Wall -Wextra -I. -I../common diff --git a/day05/Makefile b/day05/Makefile @@ -1,7 +1,7 @@ NAME=$(shell basename ${PWD}) CC=cc SRC=$(wildcard *.c) -DEPS:=$(wildcard *.h) +DEPS:=$(wildcard *.h ../common/*.h) OBJ:=$(SRC:.c=.o) CFLAGS=-O2 -std=c99 -Werror -Wall -Wextra -I. -I../common diff --git a/day07/Makefile b/day07/Makefile @@ -1,7 +1,7 @@ NAME=$(shell basename ${PWD}) CC=cc SRC=$(wildcard *.c) -DEPS:=$(wildcard *.h) +DEPS:=$(wildcard *.h ../common/*.h) OBJ:=$(SRC:.c=.o) CFLAGS=-O0 -g -std=c99 -Werror -Wall -Wextra -I. -I../common LDFLAGS=-lc -lm diff --git a/day07/puzzle.c b/day07/puzzle.c @@ -51,7 +51,7 @@ void puzzle(const char *filename, size_t *result1, size_t *result2) { *result1 += abs(data[i] - mid); } - // geometric average + // mean average double sum = 0; for (size_t i = 0; i < numbers.count; ++i) { sum += data[i];