-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
29 lines (23 loc) · 837 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "file.h"
#include "intcode.h"
#include <iostream>
#include <vector>
namespace aoc2019_day09 {
unsigned long long part_1(std::string_view path, int id = 1) {
std::vector<long long> input = file::readFileAsArrayLongLong(path, ",");
intcode::IntCode calc{input, {id, 0}};
return calc.advance().returnValue;
}
unsigned long long part_2(std::string_view path, int id = 2) {
std::vector<long long> input = file::readFileAsArrayLongLong(path, ",");
intcode::IntCode calc{input, {id, 0}};
return calc.advance().returnValue;
}
}
#ifndef TESTING
int main() {
std::cout << "Part 1: " << aoc2019_day09::part_1("../2019/day09/input.in") << std::endl;
std::cout << "Part 2: " << aoc2019_day09::part_2("../2019/day09/input.in") << std::endl;
return 0;
}
#endif