parent
2e133c698b
commit
89b1cea36a
57 changed files with 638 additions and 28 deletions
@ -0,0 +1,17 @@ |
||||
import os |
||||
|
||||
|
||||
preH = open("pre.h", "r").read() |
||||
preCpp = open("pre.cpp", "r").read() |
||||
|
||||
for dayNum in range(1, 26): |
||||
pad = f'{dayNum:02}' |
||||
dirName = f"src/days/{pad}" |
||||
try: |
||||
os.mkdir(dirName) |
||||
except OSError: |
||||
continue |
||||
with open(f"{dirName}/Day{pad}.h", "w") as file: |
||||
file.write(preH.replace("XX", pad)) |
||||
with open(f"{dirName}/Day{pad}.cpp", "w") as file: |
||||
file.write(preCpp.replace("XX", pad)) |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "DayXX.h" |
||||
|
||||
Result DayXX::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result DayXX::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAYXX_H |
||||
#define ADVENTOFCODE2022_DAYXX_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class DayXX : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -1,17 +0,0 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAYS_H |
||||
#define ADVENTOFCODE2022_DAYS_H |
||||
|
||||
#include "01/Day01.h" |
||||
#include "02/Day02.h" |
||||
#include "03/Day03.h" |
||||
|
||||
std::vector<Day*> getAllDays(){ |
||||
return std::vector<Day*> { |
||||
new Day01(), |
||||
new Day02(), |
||||
new Day03() |
||||
}; |
||||
} |
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day04.h" |
||||
|
||||
Result Day04::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day04::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY04_H |
||||
#define ADVENTOFCODE2022_DAY04_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day04 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day05.h" |
||||
|
||||
Result Day05::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day05::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY05_H |
||||
#define ADVENTOFCODE2022_DAY05_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day05 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day06.h" |
||||
|
||||
Result Day06::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day06::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY06_H |
||||
#define ADVENTOFCODE2022_DAY06_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day06 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day07.h" |
||||
|
||||
Result Day07::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day07::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY07_H |
||||
#define ADVENTOFCODE2022_DAY07_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day07 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day08.h" |
||||
|
||||
Result Day08::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day08::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY08_H |
||||
#define ADVENTOFCODE2022_DAY08_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day08 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day09.h" |
||||
|
||||
Result Day09::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day09::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY09_H |
||||
#define ADVENTOFCODE2022_DAY09_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day09 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day10.h" |
||||
|
||||
Result Day10::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day10::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY10_H |
||||
#define ADVENTOFCODE2022_DAY10_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day10 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day11.h" |
||||
|
||||
Result Day11::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day11::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY11_H |
||||
#define ADVENTOFCODE2022_DAY11_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day11 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day12.h" |
||||
|
||||
Result Day12::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day12::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY12_H |
||||
#define ADVENTOFCODE2022_DAY12_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day12 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day13.h" |
||||
|
||||
Result Day13::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day13::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY13_H |
||||
#define ADVENTOFCODE2022_DAY13_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day13 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day14.h" |
||||
|
||||
Result Day14::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day14::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY14_H |
||||
#define ADVENTOFCODE2022_DAY14_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day14 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day15.h" |
||||
|
||||
Result Day15::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day15::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY15_H |
||||
#define ADVENTOFCODE2022_DAY15_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day15 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day16.h" |
||||
|
||||
Result Day16::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day16::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY16_H |
||||
#define ADVENTOFCODE2022_DAY16_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day16 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day17.h" |
||||
|
||||
Result Day17::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day17::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY17_H |
||||
#define ADVENTOFCODE2022_DAY17_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day17 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day18.h" |
||||
|
||||
Result Day18::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day18::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY18_H |
||||
#define ADVENTOFCODE2022_DAY18_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day18 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day19.h" |
||||
|
||||
Result Day19::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day19::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY19_H |
||||
#define ADVENTOFCODE2022_DAY19_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day19 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day20.h" |
||||
|
||||
Result Day20::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day20::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY20_H |
||||
#define ADVENTOFCODE2022_DAY20_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day20 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day21.h" |
||||
|
||||
Result Day21::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day21::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY21_H |
||||
#define ADVENTOFCODE2022_DAY21_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day21 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day22.h" |
||||
|
||||
Result Day22::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day22::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY22_H |
||||
#define ADVENTOFCODE2022_DAY22_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day22 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day23.h" |
||||
|
||||
Result Day23::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day23::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY23_H |
||||
#define ADVENTOFCODE2022_DAY23_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day23 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day24.h" |
||||
|
||||
Result Day24::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day24::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY24_H |
||||
#define ADVENTOFCODE2022_DAY24_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day24 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,10 @@ |
||||
|
||||
#include "Day25.h" |
||||
|
||||
Result Day25::Task1() { |
||||
return Day::Task1(); |
||||
} |
||||
|
||||
Result Day25::Task2() { |
||||
return Day::Task2(); |
||||
} |
@ -0,0 +1,14 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAY25_H |
||||
#define ADVENTOFCODE2022_DAY25_H |
||||
|
||||
#include "../../Day.h" |
||||
|
||||
class Day25 : public Day { |
||||
protected: |
||||
Result Task1() override; |
||||
Result Task2() override; |
||||
}; |
||||
|
||||
|
||||
#endif |
@ -0,0 +1,61 @@ |
||||
|
||||
#ifndef ADVENTOFCODE2022_DAYS_H |
||||
#define ADVENTOFCODE2022_DAYS_H |
||||
|
||||
#include "01/Day01.h" |
||||
#include "02/Day02.h" |
||||
#include "03/Day03.h" |
||||
#include "04/Day04.h" |
||||
#include "05/Day05.h" |
||||
#include "06/Day06.h" |
||||
#include "07/Day07.h" |
||||
#include "08/Day08.h" |
||||
#include "09/Day09.h" |
||||
#include "10/Day10.h" |
||||
#include "11/Day11.h" |
||||
#include "12/Day12.h" |
||||
#include "13/Day13.h" |
||||
#include "14/Day14.h" |
||||
#include "15/Day15.h" |
||||
#include "16/Day16.h" |
||||
#include "17/Day17.h" |
||||
#include "18/Day18.h" |
||||
#include "19/Day19.h" |
||||
#include "20/Day20.h" |
||||
#include "21/Day21.h" |
||||
#include "22/Day22.h" |
||||
#include "23/Day23.h" |
||||
#include "24/Day24.h" |
||||
#include "25/Day25.h" |
||||
|
||||
std::vector<Day*> getAllDays(){ |
||||
return { |
||||
new Day01(), |
||||
new Day02(), |
||||
new Day03(), |
||||
new Day04(), |
||||
new Day05(), |
||||
new Day06(), |
||||
new Day07(), |
||||
new Day08(), |
||||
new Day09(), |
||||
new Day10(), |
||||
new Day11(), |
||||
new Day12(), |
||||
new Day13(), |
||||
new Day14(), |
||||
new Day15(), |
||||
new Day16(), |
||||
new Day17(), |
||||
new Day18(), |
||||
new Day19(), |
||||
new Day20(), |
||||
new Day21(), |
||||
new Day22(), |
||||
new Day23(), |
||||
new Day24(), |
||||
new Day25() |
||||
}; |
||||
} |
||||
|
||||
#endif |
Loading…
Reference in new issue