You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-14Lines changed: 19 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,13 @@ Solutions for [Advent of Code](https://adventofcode.com/) in [Rust](https://www.
12
12
13
13
This template supports all major OS (macOS, Linux, Windows).
14
14
15
-
### Create your repository
15
+
### Create your repository 📝
16
16
17
17
1. Open [the template repository](https://github.com/fspoettel/advent-of-code-rust) on Github.
18
-
2. Click `Use this template` and create your repository.
18
+
2. Click [Use this template](https://github.com/fspoettel/advent-of-code-rust/generate) and create your repository.
19
19
3. Clone your repository to your computer.
20
20
21
-
### Setup rust
21
+
### Setup rust 💻
22
22
23
23
1. Install the [Rust toolchain](https://www.rust-lang.org/tools/install).
24
24
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>
46
46
47
47
Individual solutions live in the `./src/bin/` directory as separate binaries.
48
48
49
-
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.
49
+
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.
50
50
51
51
When editing a solution, `rust-analyzer` will display buttons for running / debugging unit tests above the unit test blocks.
52
52
@@ -119,7 +119,7 @@ cargo all
119
119
120
120
_Total timing_ is computed from individual solution _timings_ and excludes as much overhead as possible.
121
121
122
-
### Run all solutions against example input
122
+
### Run all solutions against the example input
123
123
124
124
```sh
125
125
cargo test
@@ -150,7 +150,7 @@ Once installed, you can use the [download command](#download-input-for-a-day).
150
150
151
151
Uncomment the `clippy` job in the `ci.yml` workflow to enable clippy checks in CI.
152
152
153
-
### Automatically track ⭐️ progress in readme
153
+
### Automatically track ⭐️ progress in the readme
154
154
155
155
This template includes [a Github action](https://github.com/k2bd/advent-readme-stars) that automatically updates the readme with your advent of code progress.
156
156
@@ -171,10 +171,10 @@ Go to the _Secrets_ tab in your repository settings and create the following sec
171
171
172
172
### Use VS Code to debug your code
173
173
174
-
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).
175
-
2. Set breakpoints in your code. [^3]
176
-
3. Click _Debug_ next to the unit test or the _main_ function. [^4]
177
-
4. The debugger will halt your program at the specific line and allow you to inspect the local stack. [^5]
174
+
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).
175
+
2. Set breakpoints in your code. [^3]
176
+
3. Click _Debug_ next to the unit test or the _main_ function. [^4]
177
+
4. The debugger will halt your program at the specific line and allow you to inspect the local stack. [^5]
178
178
179
179
## Useful crates
180
180
@@ -188,12 +188,17 @@ Do you have aoc-specific crate recommendations? [Share them!](https://github.com
188
188
189
189
## Common pitfalls
190
190
191
-
***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.
191
+
-**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.
192
192
193
193
## Footnotes
194
194
195
195
[^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.
196
196
[^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.
197
-
[^3]: <imgsrc="https://user-images.githubusercontent.com/1682504/198838369-453dc22c-c645-4803-afe0-fc50d5a3f00c.png"alt="Set a breakpoint"width="450" />
0 commit comments