Kushagra-0801 / adventofcode-rs

template for advent of code in rust
5 stars 2 forks source link

Looks interesting, but... #2

Open dantho opened 3 years ago

dantho commented 3 years ago

Perhaps I'm a newbie, but how do you build / use this template?

Your Readme is not much help to me. :(

I've stumbled around with cargo build and have populated the src directory with empty solutions, but I don't know what to do next, or how to use the .ENV file.

Kushagra-0801 commented 3 years ago
  1. Do an initial build with the AOC_YEAR and AOC_SESSION environment variables set. After this you can delete build.rs.
  2. Write your code in the generated files in src/solutions/day$i.rs.
  3. Run cargo run -- init <day> to download your input.
  4. Run cargo run -- run <day> [--part <part>] [--extra arg1 arg2 arg3] [--input path/to/input] In case you don't know, the part in [] is optional. Skipping --part will run both part 1 and part 2. Skipping --extra will give an empty Vec<T> of extra args. Skipping --input will look for the download input. Do note that input is not downloaded automatically and you need to run step 3.
Kushagra-0801 commented 3 years ago

I hope that fixes your doubt.

dantho commented 3 years ago

Thanks. That's helpful.