Skip to content

Commit beb8c84

Browse files
committed
Stub out day 15 in C++
1 parent 4f4af19 commit beb8c84

File tree

8 files changed

+85
-1
lines changed

8 files changed

+85
-1
lines changed

.github/workflows/run.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
os: ['ubuntu-latest', 'macos-latest']
14-
day: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14']
14+
day: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15']
1515
exclude:
1616
# TODO: Investigate why building Zig on macOS fails
1717
# https://github.com/fwcd/advent-of-code-2024/actions/runs/12202208638/job/34042374507

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ My solutions to the [Advent of Code 2024](https://adventofcode.com/2024), writte
2020
- [x] [**Day 12**](day12): [Objective-C](day12/src/day12.m)
2121
- [x] [**Day 13**](day13): [Python](day13/src/day13.py)
2222
- [x] [**Day 14**](day14): [Haskell](day14/src/Day14.hs)
23+
- [ ] [**Day 15**](day15): [C++](day15/src/day15.cpp)
2324

2425
## Development
2526

day15/derivation.nix

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{ stdenv }:
2+
stdenv.mkDerivation {
3+
name = "advent-of-code-2024-day15";
4+
src = ./src;
5+
6+
buildPhase = ''
7+
mkdir -p out
8+
$CXX -o out/day15 day15.cpp
9+
'';
10+
11+
installPhase = ''
12+
mkdir -p $out/bin
13+
cp out/day15 $out/bin
14+
'';
15+
}

day15/flake.lock

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

day15/flake.nix

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
description = "Advent of Code 2024 - Day 15 solution";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
6+
};
7+
8+
outputs = { self, nixpkgs }:
9+
let
10+
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
11+
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
12+
in {
13+
packages = forAllSystems (system:
14+
let
15+
pkgs = import nixpkgs { inherit system; };
16+
in {
17+
default = pkgs.callPackage ./derivation.nix {};
18+
}
19+
);
20+
21+
apps = forAllSystems (system: {
22+
default = {
23+
type = "app";
24+
program = "${self.packages.${system}.default}/bin/day15";
25+
};
26+
});
27+
};
28+
}

day15/resources/demo.txt

Whitespace-only changes.

day15/src/day15.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <iostream>
2+
3+
int main() {
4+
std::cout << "Hello" << std::endl;
5+
return 0;
6+
}

paths.json

+7
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,12 @@
110110
},
111111
"path": "day14/src/Day14.hs",
112112
"completed": true
113+
},
114+
{
115+
"lang": {
116+
"codemirror": "clike",
117+
"name": "C++"
118+
},
119+
"path": "day15/src/day15.cpp"
113120
}
114121
]

0 commit comments

Comments
 (0)