Skip to content

Sekky61/rust-iterator-aoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code

challanges.iter()
          .map(solve)
          .collect::<Vec<_>>()

Solution to some of the AoC challanges.

  • Written in Rust, trying to use iterators where possible.
  • Includes a script to setup a new challange.

Highlights

challange solution
2022/07 solution
2022/24 solution

Usage

Requires up to date Rust toolchain and Python 3.

Setup script

Set AOC_SESSION_ID environment variable to your session ID (can be found in cookies after logging in to AoC website). Then, run the script with year and day as arguments:

day_setup.py [year] [day]

This will set up a new Rust module in src/year/day.rs and download the input to inputs/year/day.txt. Then, add a line to impl Dispatch located in src/util/mod.rs (see other lines of the match statement).

AoC challange

To run the solution for a given year, day and part, use:

cargo run --release -- --year <YEAR> --day <DAY> --part <PART>

Example

day_setup.py 22 1
cargo run --release -- --year 2022 --day 1 --part 1

About

Advent of Code challanges solved using Rust's iterators and functional programming

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published