This repository contains Advent of Code solutions by EagleLizard.
Advent of code 2024 solutions are in the ./2024 directory.
Solutions are in Go, Lua, Zig, and JavaScript (via NodeJS).
- Go @
1.23.1
Run via:
go run src/main.goRun and watch for changes:
make watch-go- Lua @
5.4.7 - Luarocks
On MacOS:
brew install luarocksRun the following to install dependencies:
luarocks install --deps-only 2024-dev-1.rockspecmake run-luaor:
lua init.luaTo watch for changes:
make watch-lua- Zig @
0.13.0
Run:
make br-zigOr to watch for changes:
make brw-zig- NodeJS @
22.13.1(vianvm)
Get nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bashInstall & switch to 22.13.1:
nvm install 22.13.1
nvm use 22.13.1My intent was to do this with zero dependencies, so you should just be able to run it with node (we'll see how well I keep to this).
However, if you want linting or whatever other dev stuff I made you can install dependencies:
npm inode src/main.jsTo watch for changes:
node --watch src/main.jsOr using fswatch via make:
make watch-jsAdvent of Code 2023 solutions are in the ./2023 directory.
Solutions are created in Typescript + NodeJS and Rust.
It's recommended to use nvm to manage node and npm versions.
- NodeJS @
v21.4.0 - Typescript @
v5.3.2
In the 2023 directory, install dependencies:
npm iIf you have typescript installed globally, run:
tscOtherwise, you can prefix the command with npx to use the binary installed in node_modules:
npx tscTo run the compiler in watch mode:
tsc -wAfter compiling, the transpiled JS code will be in the dist folder.
Run the program by executing the main.js file with node:
node dist/main.jsIt's recommended to use rustup to manage versions, see Rust's official Getting Started page for installation instructions.
- cargo @
1.72.1
To use the Makefile and run the project in watch mode, install cargo-watch:
cargo install cargo-watchIn the 2023 directory, run:
cargo buildIf you built the executable already via the previous section, you can run:
./target/debug/aoc2023Alternatively, you can build and run the project using:
cargo watch -x runYou can also run in watch mode using:
make watchOn MacOS, uses g++ which is an alias to clang.
- cmake @
3.27.7 - fswatch @
1.17.1
To use the Makefile and run the project in watch mode, install fswatch:
brew install fswatchIn the 2023 directory, run:
make build-cppIf you built the executable already via the previous section, you can run:
./cpp-out/aoc2023cppAlternatively, you can build and run the project using:
make run-cppYou can also run in watch mode using:
make watch-cpp