summaryrefslogtreecommitdiff
path: root/04.c
diff options
context:
space:
mode:
authorVincent Douillet <vincent@vdouillet.fr>2021-12-05 22:53:32 +0100
committerVincent Douillet <vincent@vdouillet.fr>2021-12-05 22:53:32 +0100
commit8a8417207729cb92ae4f3038a3a8bd5e6a0c0ce7 (patch)
treea1366131e356ffadfa081c1561c968a2570a9843 /04.c
parent4c42453d856053bb49affef7c165397e5c16d9eb (diff)
add expected results to previous days
Diffstat (limited to '04.c')
-rw-r--r--04.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/04.c b/04.c
index 7077b65..499461b 100644
--- a/04.c
+++ b/04.c
@@ -5,6 +5,9 @@
#include "input.h"
#define INPUT "input/04.txt"
+#define EXPECTED1 51776L
+#define EXPECTED2 16830L
+
#define BOARD_COUNT 100
#define BOARD_SIZE 5
#define MAX_DRAW 500
@@ -104,7 +107,7 @@ void part1(struct input_str* input) {
if(board_mark(&(board_list[j]), draw_list[i])) {
// winning board found, print score
long score = board_unmarked_sum(&(board_list[j]));
- printf("%ld\n", draw_list[i] * score);
+ CHECK(draw_list[i] * score, EXPECTED1)
return;
}
}
@@ -134,7 +137,7 @@ void part2(struct input_str* input) {
}
}
// print last winning
- printf("%ld\n", last_score);
+ CHECK(last_score, EXPECTED2)
}
int main() {