File tree Expand file tree Collapse file tree 9 files changed +24
-16
lines changed
Expand file tree Collapse file tree 9 files changed +24
-16
lines changed Original file line number Diff line number Diff line change 1- = Day 0 =
2-
3- I'll try to solve this year's edition with https://rust-lang.org[Rust].
1+ == Day 0: Hello World ==
42
53All days should run using `cargo run` .
4+
5+ My hello world prints Ferris:
6+ ....
7+ This year I became a Rustacian!
8+ _~^~^~_
9+ \) / o o \ (/
10+ '_ ¬ _'
11+ \ '-----' /
12+ ....
13+
614I also plan to add some simple tests based on the example data from the puzzle descriptions which can be executed using `cargo test` .
715
816Tests are implemented in the same source file with the code in a separate `tests` module which is excluded from the regular binary:
917
10- [sourc ,rust,numbered]
18+ [source ,rust,numbered]
1119....
1220include::src/main.rs[tags=test]
1321....
Original file line number Diff line number Diff line change 1- = Day 1: Report Repair =
1+ == Day 1: Report Repair = =
22
33Run solution with `cargo run`
44
Original file line number Diff line number Diff line change 1- = Day 2: Password Philosophy =
1+ == Day 2: Password Philosophy = =
22
33Run solution with `cargo run`
44
Original file line number Diff line number Diff line change 1- = Day 3: Toboggan Trajectory =
1+ == Day 3: Toboggan Trajectory = =
22
33Run solution with `cargo run`
44
Original file line number Diff line number Diff line change 1- = Day 4: Passport Processing =
1+ == Day 4: Passport Processing = =
22
33Run solution with `cargo run`
44
Original file line number Diff line number Diff line change 1- = Day 5: Binary Boarding =
1+ == Day 5: Binary Boarding = =
22
33Run solution with `cargo run`
44
Original file line number Diff line number Diff line change 1- = Day 6: Custom Customs =
1+ == Day 6: Custom Customs = =
22
33Run solution with `cargo run`
44
Original file line number Diff line number Diff line change 1- = Day 7: Handy Haversacks =
1+ == Day 7: Handy Haversacks = =
22
33Run solution with `cargo run`
44
55Run tests on example data with `cargo test`
66
7- == Part 1 ==
7+ === Part 1 = ==
88
99Part 1 is solved with a breadth first search:
1010
@@ -13,7 +13,7 @@ Part 1 is solved with a breadth first search:
1313include::src/main.rs[tags=explore_parents]
1414....
1515
16- == Part 2 ==
16+ === Part 2 = ==
1717
1818Part 2 is solved with a recursive algorithm:
1919
Original file line number Diff line number Diff line change 1- = Day 8: Handheld Halting =
1+ == Day 8: Handheld Halting = =
22
33Rust solution for https://https://adventofcode.com/2020/day/8[AoC 2020, day 8].
44
@@ -8,7 +8,7 @@ Run some tests based on example data from
88https://https://adventofcode.com/2020/day/8[puzzle description]
99with `cargo test`
1010
11- == Part 1 ==
11+ === Part 1 = ==
1212
1313Instructions are modeled as an enum type with some derived traits:
1414
@@ -24,7 +24,7 @@ Run program and store positions visited in a set until position repeats:
2424include::src/main.rs[tags=run]
2525....
2626
27- == Part 2 ==
27+ === Part 2 = ==
2828
2929Alter instructions `nop <--> jmp` one by one until the program terminates without repetition:
3030
You can’t perform that action at this time.
0 commit comments