From 60f49c27051481e069a921373ffe91ad1b0ed053 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Tue, 29 Nov 2022 22:09:15 +0000 Subject: [PATCH] Created base solution struct and added all 25 days --- AdventOfCode2022.vcxproj | 25 +++++++++++ AdventOfCode2022.vcxproj.filters | 75 ++++++++++++++++++++++++++++++++ src/aoc2022.h | 5 ++- src/days/Source.cpp | 11 +++++ src/days/day01.cpp | 0 src/days/day02.cpp | 0 src/days/day03.cpp | 0 src/days/day04.cpp | 0 src/days/day05.cpp | 0 src/days/day06.cpp | 0 src/days/day07.cpp | 0 src/days/day08.cpp | 0 src/days/day09.cpp | 0 src/days/day10.cpp | 0 src/days/day11.cpp | 0 src/days/day12.cpp | 0 src/days/day13.cpp | 0 src/days/day14.cpp | 0 src/days/day15.cpp | 0 src/days/day16.cpp | 0 src/days/day17.cpp | 0 src/days/day18.cpp | 0 src/days/day19.cpp | 0 src/days/day20.cpp | 0 src/days/day21.cpp | 0 src/days/day22.cpp | 0 src/days/day23.cpp | 0 src/days/day24.cpp | 0 src/days/day25.cpp | 0 src/main.cpp | 24 ++++++++-- 30 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 src/days/Source.cpp create mode 100644 src/days/day01.cpp create mode 100644 src/days/day02.cpp create mode 100644 src/days/day03.cpp create mode 100644 src/days/day04.cpp create mode 100644 src/days/day05.cpp create mode 100644 src/days/day06.cpp create mode 100644 src/days/day07.cpp create mode 100644 src/days/day08.cpp create mode 100644 src/days/day09.cpp create mode 100644 src/days/day10.cpp create mode 100644 src/days/day11.cpp create mode 100644 src/days/day12.cpp create mode 100644 src/days/day13.cpp create mode 100644 src/days/day14.cpp create mode 100644 src/days/day15.cpp create mode 100644 src/days/day16.cpp create mode 100644 src/days/day17.cpp create mode 100644 src/days/day18.cpp create mode 100644 src/days/day19.cpp create mode 100644 src/days/day20.cpp create mode 100644 src/days/day21.cpp create mode 100644 src/days/day22.cpp create mode 100644 src/days/day23.cpp create mode 100644 src/days/day24.cpp create mode 100644 src/days/day25.cpp diff --git a/AdventOfCode2022.vcxproj b/AdventOfCode2022.vcxproj index 974ec14..cbb3a08 100644 --- a/AdventOfCode2022.vcxproj +++ b/AdventOfCode2022.vcxproj @@ -127,6 +127,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AdventOfCode2022.vcxproj.filters b/AdventOfCode2022.vcxproj.filters index 4173ad4..114ae7b 100644 --- a/AdventOfCode2022.vcxproj.filters +++ b/AdventOfCode2022.vcxproj.filters @@ -18,6 +18,81 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + diff --git a/src/aoc2022.h b/src/aoc2022.h index 2c9a62d..338e495 100644 --- a/src/aoc2022.h +++ b/src/aoc2022.h @@ -10,12 +10,13 @@ struct SDay { SDay(std::string); ~SDay(); - virtual Output part1() const {}; - virtual Output part2() const {}; + virtual Output part1() const = 0; + virtual Output part2() const = 0; }; template SDay::SDay(std::string name) { + this->name = name; input.open("input/" + name, std::ios::in); } diff --git a/src/days/Source.cpp b/src/days/Source.cpp new file mode 100644 index 0000000..9d1b58d --- /dev/null +++ b/src/days/Source.cpp @@ -0,0 +1,11 @@ +#include "../aoc2022.h" + +template +struct SDay01 : public SDay { + //Class constructor + using SDay::SDay; + + //Solutions to both days + Output part1() const override final { return Output(); } + Output part2() const override final { return Output(); } +}; \ No newline at end of file diff --git a/src/days/day01.cpp b/src/days/day01.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day02.cpp b/src/days/day02.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day03.cpp b/src/days/day03.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day04.cpp b/src/days/day04.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day05.cpp b/src/days/day05.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day06.cpp b/src/days/day06.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day07.cpp b/src/days/day07.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day08.cpp b/src/days/day08.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day09.cpp b/src/days/day09.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day10.cpp b/src/days/day10.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day11.cpp b/src/days/day11.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day12.cpp b/src/days/day12.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day13.cpp b/src/days/day13.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day14.cpp b/src/days/day14.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day15.cpp b/src/days/day15.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day16.cpp b/src/days/day16.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day17.cpp b/src/days/day17.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day18.cpp b/src/days/day18.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day19.cpp b/src/days/day19.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day20.cpp b/src/days/day20.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day21.cpp b/src/days/day21.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day22.cpp b/src/days/day22.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day23.cpp b/src/days/day23.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day24.cpp b/src/days/day24.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/days/day25.cpp b/src/days/day25.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/main.cpp b/src/main.cpp index 584fab8..7788d05 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,25 @@ #include "aoc2022.h" -#include #include +#include "days/Source.cpp" + +void createDays() { + std::string fileName; + std::ofstream file; + for (int i = 1; i <= 25; i++) + { + if (i < 10) + { + file.open("src/days/day0" + std::to_string(i) + ".cpp"); + } + else + { + file.open("src/days/day" + std::to_string(i) + ".cpp"); + } + file.close(); + } +} int main() { - -} \ No newline at end of file + SDay01 day1("day01"); + createDays(); +}