docs: typos

This commit is contained in:
Felix Spöttel 2022-11-29 09:53:20 +01:00
parent ffc7cdb4ce
commit 3ac30268ea
1 changed files with 19 additions and 14 deletions

View File

@ -12,13 +12,13 @@ Solutions for [Advent of Code](https://adventofcode.com/) in [Rust](https://www.
This template supports all major OS (macOS, Linux, Windows).
### Create your repository
### Create your repository 📝
1. Open [the template repository](https://github.com/fspoettel/advent-of-code-rust) on Github.
2. Click `Use this template` and create your repository.
2. Click [Use this template](https://github.com/fspoettel/advent-of-code-rust/generate) and create your repository.
3. Clone your repository to your computer.
### Setup rust
### Setup rust 💻
1. Install the [Rust toolchain](https://www.rust-lang.org/tools/install).
2. (recommended) Install the [rust-analyzer](https://rust-analyzer.github.io/manual.html) extension for your code editor.
@ -46,7 +46,7 @@ cargo scaffold <day>
Individual solutions live in the `./src/bin/` directory as separate binaries.
Every [solution](https://github.com/fspoettel/advent-of-code-rust/blob/main/src/bin/scaffold.rs#L11-L41) has _unit tests_ referencing its _example_ file. Use these unit tests to develop and debug your solution against example inputs. For some puzzles, it might be easier to forgo the example file and hardcode inputs into the tests.
Every [solution](https://github.com/fspoettel/advent-of-code-rust/blob/main/src/bin/scaffold.rs#L11-L41) has _unit tests_ referencing its _example_ file. Use these unit tests to develop and debug your solution against the example input. For some puzzles, it might be easier to forgo the example file and hardcode inputs into the tests.
When editing a solution, `rust-analyzer` will display buttons for running / debugging unit tests above the unit test blocks.
@ -119,7 +119,7 @@ cargo all
_Total timing_ is computed from individual solution _timings_ and excludes as much overhead as possible.
### Run all solutions against example input
### Run all solutions against the example input
```sh
cargo test
@ -150,7 +150,7 @@ Once installed, you can use the [download command](#download-input-for-a-day).
Uncomment the `clippy` job in the `ci.yml` workflow to enable clippy checks in CI.
### Automatically track ⭐️ progress in readme
### Automatically track ⭐️ progress in the readme
This template includes [a Github action](https://github.com/k2bd/advent-readme-stars) that automatically updates the readme with your advent of code progress.
@ -171,10 +171,10 @@ Go to the _Secrets_ tab in your repository settings and create the following sec
### Use VS Code to debug your code
1. Install [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) and [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb).
2. Set breakpoints in your code. [^3]
3. Click _Debug_ next to the unit test or the _main_ function. [^4]
4. The debugger will halt your program at the specific line and allow you to inspect the local stack. [^5]
1. Install [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) and [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb).
2. Set breakpoints in your code. [^3]
3. Click _Debug_ next to the unit test or the _main_ function. [^4]
4. The debugger will halt your program at the specific line and allow you to inspect the local stack. [^5]
## Useful crates
@ -188,12 +188,17 @@ Do you have aoc-specific crate recommendations? [Share them!](https://github.com
## Common pitfalls
* **Integer overflows:** This template uses 32-bit integers by default because it is generally faster - for example when packed in large arrays or structs - than using 64-bit integers everywhere. For some problems, solutions for real input might exceed 32-bit integer space. While this is checked and panics in `debug` mode, integers [wrap](https://doc.rust-lang.org/book/ch03-02-data-types.html#integer-overflow) in `release` mode, leading to wrong output when running your solution.
- **Integer overflows:** This template uses 32-bit integers by default because it is generally faster - for example when packed in large arrays or structs - than using 64-bit integers everywhere. For some problems, solutions for real input might exceed 32-bit integer space. While this is checked and panics in `debug` mode, integers [wrap](https://doc.rust-lang.org/book/ch03-02-data-types.html#integer-overflow) in `release` mode, leading to wrong output when running your solution.
## Footnotes
[^1]: The session cookie might expire after a while (~1 month) which causes the downloads to fail. To fix this issue, refresh the `.adventofcode.session` file.
[^2]: The session cookie might expire after a while (~1 month) which causes the automated workflow to fail. To fix this issue, refresh the AOC_SESSION secret.
[^3]: <img src="https://user-images.githubusercontent.com/1682504/198838369-453dc22c-c645-4803-afe0-fc50d5a3f00c.png" alt="Set a breakpoint" width="450" />
[^4]: <img alt="Run debugger" src="https://user-images.githubusercontent.com/1682504/198838372-c89369f6-0d05-462e-a4c7-8cd97b0912e6.png" width="450" />
[^5]: <img alt="Inspect debugger state" src="https://user-images.githubusercontent.com/1682504/198838373-36df6996-23bf-4757-9335-0bc4c1db0276.png" width="450" />
[^3]:
<img src="https://user-images.githubusercontent.com/1682504/198838369-453dc22c-c645-4803-afe0-fc50d5a3f00c.png" alt="Set a breakpoint" width="450" />
[^4]:
<img alt="Run debugger" src="https://user-images.githubusercontent.com/1682504/198838372-c89369f6-0d05-462e-a4c7-8cd97b0912e6.png" width="450" />
[^5]:
<img alt="Inspect debugger state" src="https://user-images.githubusercontent.com/1682504/198838373-36df6996-23bf-4757-9335-0bc4c1db0276.png" width="450" />