Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/dariodip/advent-of-code

Solutions for the Advent of Code challenge using Rust
https://github.com/dariodip/advent-of-code

advent-of-code challenge rust

Last synced: 1 day ago
JSON representation

Solutions for the Advent of Code challenge using Rust

Awesome Lists containing this project

README

        

# Advent of Code solutions

[![Pipeline](https://github.com/dariodip/advent-of-code-2021/actions/workflows/rust.yml/badge.svg?branch=master)](https://github.com/dariodip/advent-of-code-2021/actions/workflows/rust.yml)

Solutions to [Advent of Code](https://adventofcode.com/) problems 2021 in Rust.

This repository holds a single Rust project that contains all the days.

## Run the solutions

The command line tool takes ` ` as arguments and reads the problem input from `stdin`.
To run the solution for the first part of day `1` you can run:
```sh
$ cat src/year2021/day01_input.txt | cargo run -q 1 2
```

## Add new solutions

To add a new solution (*day*), you need to:
- Create a file `day01.rs` under `src/year2021`;
- Add a function `pub fn solve(input: &mut Input) -> Result` under that file;
- Export the function in `src/year2021/mod.rs`;

## Git hooks configuration
Execute this command to setup git hooks:
```
git config --local core.hooksPath ./hooks
```
# advent-of-code-ex