Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/drowrin/aoc2022

My Advent of Code 2022 solutions in Rust!
https://github.com/drowrin/aoc2022

advent-of-code advent-of-code-2022 rust

Last synced: about 2 months ago
JSON representation

My Advent of Code 2022 solutions in Rust!

Awesome Lists containing this project

README

        

# Advent of Code 2022
My solutions in Rust!

## Usage
This repo uses [just](https://github.com/casey/just) to run common commands.

Since I assume you've got cargo:
```sh
cargo install just
```

You can then use the following commands:
```sh
# Initialize a project with a name based on
just new

# Same as above, but copies over example data, input data, and your previous solution
# Useful for part two of each day
just new

# Run your solution for a day on the example data, and compare to the example answer
just test

# Run your solution on your unique input data, and output the answer
just run

# Transfer example data, input data, and solution from one day to another
# Useful if you forgot to do `just new `
# Be careful! This will overwrite files in the `to` directory
just transfer
```

### Naming Convention
The `just` commands enforce a naming convention for "days". They must all be a 2 digit number from 01-25, followed by a single lowercase letter. This ensures the folders will sort nicely and are easy to work with. The letter at the end is useful for separating a day into two parts, such as "a" and "b".

If you want to change this behavior, edit the `validate` recipe in the `justfile`.

### Structure
Once you've made a project with `just new `, you'll need to copy some data from Advent of Code. For all of these, avoid trailing newlines.
- In `data/answer.txt`, put the example answer.
- In `data/example.txt`, put the example input.
- In `data/input.txt`, put your unique input data.
- Write your solution code in `src/solution.rs`.