2025 framework
This commit is contained in:
15
2025/Makefile
Normal file
15
2025/Makefile
Normal file
@@ -0,0 +1,15 @@
|
||||
CXX := clang++
|
||||
CXXFLAGS := -std=c++17 -Wall -Wextra -I.
|
||||
|
||||
TARGET := aoc
|
||||
SRC := aoc.cpp
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(SRC)
|
||||
$(CXX) $(CXXFLAGS) $(SRC) -o $(TARGET)
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET)
|
||||
|
||||
.PHONY: all clean
|
||||
15
2025/aoc.cpp
Normal file
15
2025/aoc.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
std::cout << "Advent of Code 2025 runner" << std::endl;
|
||||
std::cout << "©Ben Kyd 2025, All Rights Reserved" << std::endl;
|
||||
|
||||
std::cout << "\n\n Usage: -d [day] (omit for all)" << std::endl;
|
||||
|
||||
// Parse command line
|
||||
|
||||
// Find days
|
||||
|
||||
// Run days
|
||||
}
|
||||
|
||||
42
2025/aoc.hpp
Normal file
42
2025/aoc.hpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <filesystem>
|
||||
|
||||
struct FileFragment
|
||||
{
|
||||
int Line,Col;
|
||||
std::string Data;
|
||||
};
|
||||
|
||||
class File
|
||||
{
|
||||
public:
|
||||
// loads full file into memory RAII style
|
||||
// AS BLOB
|
||||
File(std::filesystem::path path);
|
||||
~File();
|
||||
|
||||
void SplitBy(char delim)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
// Tokens are garunteed to be in-order
|
||||
std::vector<FileFragment> _tokens;
|
||||
|
||||
};
|
||||
|
||||
class AOCDay
|
||||
{
|
||||
public:
|
||||
AOCDay();
|
||||
virtual ~AOCDay() = 0;
|
||||
|
||||
virtual int PartOne(const File&) = 0;
|
||||
virtual int PartTwo(const File&) = 0;
|
||||
};
|
||||
|
||||
|
||||
0
2025/day1.hpp
Normal file
0
2025/day1.hpp
Normal file
Reference in New Issue
Block a user