Skip to content

Commit 71ac28f

Browse files
committed
Stub out day 24 in Crystal
1 parent 6b80cc9 commit 71ac28f

File tree

9 files changed

+409
-1
lines changed

9 files changed

+409
-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', '15', '16', '17', '18', '19', '20', '21', '22', '23']
14+
day: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24']
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
@@ -29,6 +29,7 @@ My solutions to the [Advent of Code 2024](https://adventofcode.com/2024), writte
2929
- [x] [**Day 21**](day21): [Scala](day21/src/day21.scala)
3030
- [ ] [**Day 22**](day22): [Dart](day22/src/day22.dart)
3131
- [x] [**Day 23**](day23): [Go](day23/src/day23.go)
32+
- [ ] [**Day 24**](day24): [Crystal](day24/src/day24.cr)
3233

3334
## Development
3435

day24/derivation.nix

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{ stdenv, crystal }:
2+
stdenv.mkDerivation {
3+
name = "advent-of-code-2024-day24";
4+
src = ./src;
5+
6+
buildInputs = [
7+
crystal
8+
];
9+
10+
buildPhase = ''
11+
crystal build day24.cr
12+
'';
13+
14+
installPhase = ''
15+
mkdir -p $out/bin
16+
cp day24 $out/bin
17+
'';
18+
}

day24/flake.lock

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

day24/flake.nix

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
description = "Advent of Code 2024 - Day 24 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/day24";
25+
};
26+
});
27+
};
28+
}

day24/resources/demo.txt

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
x00: 1
2+
x01: 1
3+
x02: 1
4+
y00: 0
5+
y01: 1
6+
y02: 0
7+
8+
x00 AND y00 -> z00
9+
x01 XOR y01 -> z01
10+
x02 OR y02 -> z02

0 commit comments

Comments
 (0)