diff options
| author | Orfeas <38209077+0xfea5@users.noreply.github.com> | 2023-12-01 17:17:59 +0200 |
|---|---|---|
| committer | Orfeas <38209077+0xfea5@users.noreply.github.com> | 2023-12-01 17:17:59 +0200 |
| commit | d61566b4dc81f66693b80918c210eea8acd9a3d2 (patch) | |
| tree | 6c97ddeadcf2c1823844686aed406fc7974565e5 /init.sh | |
| download | aoc23-d61566b4dc81f66693b80918c210eea8acd9a3d2.tar.gz aoc23-d61566b4dc81f66693b80918c210eea8acd9a3d2.zip | |
day01
Diffstat (limited to 'init.sh')
| -rwxr-xr-x | init.sh | 26 |
1 files changed, 26 insertions, 0 deletions
| @@ -0,0 +1,26 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | ADVENT_SESSION=$(cat ../cookie) | ||
| 4 | |||
| 5 | if [ $# -eq 0 ]; then | ||
| 6 | echo "Usage: ./init.sh <#day>" | ||
| 7 | exit 1 | ||
| 8 | fi | ||
| 9 | |||
| 10 | DAY=$1 | ||
| 11 | YEAR=2023 | ||
| 12 | DIR=$(printf "day%02d" $DAY) | ||
| 13 | echo "Initializing day $DAY in directory $DIR" | ||
| 14 | |||
| 15 | mkdir -p $DIR && curl "https://adventofcode.com/$YEAR/day/$DAY/input" -H "Cookie: session=$ADVENT_SESSION" >$DIR/input.txt | ||
| 16 | echo \ | ||
| 17 | 'const std = @import("std"); | ||
| 18 | const print = std.debug.print; | ||
| 19 | const assert = std.debug.assert; | ||
| 20 | const input = @embedFile("./input.txt"); | ||
| 21 | |||
| 22 | pub fn main() !void { | ||
| 23 | var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | ||
| 24 | defer _ = gpa.deinit(); | ||
| 25 | var alloc = gpa.allocator(); | ||
| 26 | }' >$DIR/solution.zig | ||
