项目作者: pawroman

项目描述 :
My Rust solutions to Advent of Code 2018 challenges
高级语言: Rust
项目地址: git://github.com/pawroman/advent-of-rust-2018.git
创建时间: 2018-12-03T20:17:52Z
项目社区:https://github.com/pawroman/advent-of-rust-2018

开源协议:

下载


Advent of code 2018

Build Status

My Rust solutions to Advent of Code 2018 challenges:
https://adventofcode.com/2018

Design choices

Although one can devise much more succinct solutions
to some problems (write code in ad-hoc script
style and avoid over-engineering), my motivation was to:

  • Be correct and write the code such that it can be
    easily tested. All the code has tests (test
    coverage might not be 100%, but it’s pretty solid).

  • Apply defensive programming (assume the challenge
    can have malformed input or might never
    converge to a solution).

  • Learn more advanced Rust, in particular:

    • Testing.

    • “Production grade” error handling (never
      panic, always return structured errors).

    • Generic programming and the trait system.

    • The 2018 edition!

Running

To build & run, make sure you have Rust 1.31 or
above (using Rust 2018).

All code has tests, you can run all of them using:

  1. $ cargo test

To run one a challenge, e.g. day01, you need
to specify its name and path to input:

  1. $ cargo run --bin day01 day01/input/input

Or to run in release mode:

  1. $ cargo run --release --bin day01 day01/input/input