Solutions to the 2017 edition of Advent of Code, as an exercise in learning Rust.
To run the solutions, install rust and then build the executables.
# In the repository
$ cargo build
Compiling adventofcode_2017 v0.1.0 (file:///home/rustacean/adventofcode_2017)
Finished dev [unoptimized + debuginfo] target(s) in 0.30 secs
$./target/debug/day1
Puzzle #1: …
Puzzle #2: …
Or you can run a particular day directly.
$ cargo run --bin day1
Compiling adventofcode_2017 v0.1.0 (file:///home/rustacean/Projects/adventofcode/adventofcode_2017)
Finished dev [unoptimized + debuginfo] target(s) in 0.30 secs
Running `target/debug/day1 day1`
Puzzle #1: …
Puzzle #2: …
To run the tests:
$ cargo test
Compiling adventofcode_2017 v0.1.0 (file:///home/rustacean/Projects/adventofcode/adventofcode_2017)
Finished dev [unoptimized + debuginfo] target(s) in 0.39 secs
Running target/debug/deps/day1-100ceb28cd9a31d5
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/debug/deps/day1-d40a5742dc301053
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Doc-tests day1
running 1 test
test src/day1/lib.rs - sequence_sum (line 13) ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
The documentation can be generated with cargo doc
.