Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timstricker/aoc2024
Advent of Code 2024 in Zig
https://github.com/timstricker/aoc2024
advent-of-code advent-of-code-2024 advent-of-code-in-zig advent-of-code-zig aoc aoc-2024 aoc2024 zig ziglang
Last synced: 5 days ago
JSON representation
Advent of Code 2024 in Zig
- Host: GitHub
- URL: https://github.com/timstricker/aoc2024
- Owner: TimStricker
- License: mit
- Created: 2024-12-03T06:58:16.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-12T22:11:12.000Z (2 months ago)
- Last Synced: 2024-12-12T23:22:06.750Z (2 months ago)
- Topics: advent-of-code, advent-of-code-2024, advent-of-code-in-zig, advent-of-code-zig, aoc, aoc-2024, aoc2024, zig, ziglang
- Language: Zig
- Homepage:
- Size: 55.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Advent of Code 2024
My attempt to solve AoC 2024 in [Zig](https://github.com/ziglang/zig/). I am not
yet super familiar with the language, so don't expect the most beautiful,
idiomatic Zig code. This is really just me trying to learn.## Supported Zig version
I'm using the nightly version of Zig to solve these tasks. At the time of
writing, this is `0.14.0-dev.2465+70de2f3a7`. Note that Zig is still in active
development and new versions might have braking changes, so it is not guaranteed
that the code works with any other version.## How to run
You can find the solution for each day in the `dayXY` directories. They are all
self-contained and can simply be executed using `zig run`.As an example, here you can see how to run the solution to day 1:
```
$ zig run day01/main.zig
Total distance: 2742123
Similarity score: 21328497
Task took 8 ms to complete.
```**Note:** At the moment, the applications assume they are being called from the
repository root. If you call them from anywhere else, they won't be able to find
the input for the day. I might fix this in the future.Basically all of the solutions contain some tests with the sample input, you
can run these using `zig test /main.zig`.