From 00000110ef09b4167a734be1f1e2663b7847e8f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Fri, 2 Dec 2022 14:43:17 +0100 Subject: [PATCH] chore: simplify README.md --- README.md | 96 +++++++++++++------------------------------------------ 1 file changed, 22 insertions(+), 74 deletions(-) diff --git a/README.md b/README.md index d8d2eca..dd61ac8 100644 --- a/README.md +++ b/README.md @@ -4,84 +4,32 @@ # Advent-of-Code {YEAR} *This is a dumbed down version of [fspoettel/advent-of-code-rust](https://github.com/fspoettel/advent-of-code-rust) with some extra features* -## CLI -### Prepare +## Project overview -```sh -# example: `cargo prepare 1` -cargo prepare +### Project structure +- `src/` : + - `bin/`: + - `.rs`: solution files + - `*.rs`: convenience scripts + - `inputs/`: this directory is gitignored, input files go here + - `test_inputs/`: example files go here; you can push this as test are run in ci + - `helpers.rs`: helper functions you can reuse in solution files go here + - `lib.rs`: contains framework code + - `main.rs`: contains framework code +- `.env.example`: example dotenv file -# output: -# Created module "src/bin/01.rs" -# Created empty input file "src/inputs/01.txt" -# Created empty example file "src/examples/01.txt" -# --- -# ๐ŸŽ„ Type `cargo solve 01` to run your solution. -``` - -### Download input -prepare `.env` file -``` -cp .env.example .env -``` -set `YEAR` to whichever year you are solving for and `TOKEN` to AoC session Cookie. - -```sh -# example: `cargo download 1` -cargo download - -# output: -# Downloaded input file "src/inputs/01.txt" -``` - -### Solve -```sh -# example: `cargo solve 01` -cargo solve - -# output: -# Running `target/debug/01` -# ๐ŸŽ„ Part 1 ๐ŸŽ„ -# -# 6 (elapsed: 37.03ยตs) -# -# ๐ŸŽ„ Part 2 ๐ŸŽ„ -# -# 9 (elapsed: 33.18ยตs) -``` -Displayed timings show the raw execution time of your solution without overhead (e.g. file reads). To run an optimized version for benchmarking, append the `--release` flag. +### Cli +- `cargo prepare `: prepare solution files for `day` +- `cargo download `: download input file for `day` +- `cargo solve `: run solution against input for `day` +- `cargo all`: alias for run; runs solutions for all days -### Solve all +### dotenv -```sh -cargo all +set `YEAR` to whichever year you are solving for and `TOKEN` to AoC session Cookie -# output: -# Running `target/release/aoc` -# ---------- -# | Day 01 | -# ---------- -# ๐ŸŽ„ Part 1 ๐ŸŽ„ -# -# 0 (elapsed: 170.00ยตs) -# -# ๐ŸŽ„ Part 2 ๐ŸŽ„ -# -# 0 (elapsed: 30.00ยตs) -# <...other days...> -# Total: 0.20ms -``` - -`all` is an alias for `cargo run`. To run an optimized version for benchmarking, append the `--release` flag. - -### Run against test inputs -run all solutions -```sh -cargo test -``` -run for a given day -```sh -cargo test --bin -``` +### FAQ +#### How are your commits numbered in ascending order? +[https://westling.dev/b/extremely-linear-git](https://westling.dev/b/extremely-linear-git)