https://github.com/ageron/aoc2023-rust
Solutions of Advent-of-Code 2023 in Rust
https://github.com/ageron/aoc2023-rust
Last synced: 11 months ago
JSON representation
Solutions of Advent-of-Code 2023 in Rust
- Host: GitHub
- URL: https://github.com/ageron/aoc2023-rust
- Owner: ageron
- License: apache-2.0
- Created: 2023-12-03T03:05:36.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-29T22:26:40.000Z (over 2 years ago)
- Last Synced: 2025-05-07T23:49:08.767Z (about 1 year ago)
- Language: Rust
- Size: 208 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Advent of Code 2023 in Rust
===========================
If you've never heard of Advent of Code, you're missing out. Check it out now at [adventofcode.com](https://adventofcode.com/about)!
I mostly do AoC puzzles for fun, generally coding in Python, but I've also found that it's a great way to get some experience with other programming languages, such as Julia or Rust.
This repository contains all my solutions to the [AoC 2023](https://adventofcode.com/2023) puzzles using Rust.
As I'm still learning Rust, the code may not always be as simple or idiomatic as it could be. If you have suggestions for things I could improve, please don't hesitate to file an issue or submit a PR. Thanks!
Usage
-----
Make sure you have Rust and Git installed, then open a terminal and run:
```shell
git clone https://github.com/ageron/aoc2023-rust
cd aoc2023-rust
cargo run --release
```
You can specify days to run if you want, for example this will run days 2, 4, and 6:
```
cargo run --release 2 4 6
```
Getting the data
----------------
I've also included a little `get_data.py` utility to automatically download the data of the day, at the right time (you'll get a countdown if you're early). I was too lazy to code it in Rust, but perhaps I'll port it one day. To use it, just type the following command in a terminal, replacing `{day}` with the day you want:
```
cd /path/to/this/repository
python get_data.py 2023 {day}
```
The script requires the `requests` and `pytz` libraries, which you can install like this:
```
python -m pip install --user requests pytz
```
The first time you run `get_data.py`, you will be asked to login to AoC in your browser, [find your session cookie](https://github.com/wimglenn/advent-of-code-wim/issues/1), and save it into a `.session` file in the current directory.
Have fun!