diff options
Diffstat (limited to '03.c')
-rw-r--r-- | 03.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -5,6 +5,9 @@ #include "input.h" #define INPUT "input/03.txt" +#define EXPECTED1 2972336L +#define EXPECTED2 0L + #define INPUT_SIZE 12 unsigned long parse_line(char* binary_line, char expected_end) { @@ -48,7 +51,7 @@ unsigned long compute_epsilon(unsigned long gamma) { void part1(struct input_str* input) { unsigned long gamma = compute_gamma(input); unsigned long epsilon = compute_epsilon(gamma); - printf("%ld\n", gamma * epsilon); + CHECK(gamma * epsilon, EXPECTED1) } unsigned long search_criteria(struct input_str* input, unsigned long criteria) { @@ -91,7 +94,7 @@ void part2(struct input_str* input) { unsigned long o2_rate = search_criteria(input, o2_criteria); unsigned long co2_criteria = compute_epsilon(o2_criteria); unsigned long co2_scrub = search_criteria(input, co2_criteria); - printf("%ld\n", o2_rate * co2_scrub); + CHECK(o2_rate * co2_scrub, EXPECTED2) } int main() { |