From b0e00661b09b1d34dcee055f9b6086a11e7cd98e Mon Sep 17 00:00:00 2001 From: martapanc Date: Tue, 10 Dec 2024 18:45:05 +0100 Subject: [PATCH] Update readmes --- 2024/src/2024/README.md | 23 ++++++++++++----------- 2024/src/2024/day10/day10.ts | 6 +++--- README.md | 4 ++-- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/2024/src/2024/README.md b/2024/src/2024/README.md index cd5449f..c93432e 100644 --- a/2024/src/2024/README.md +++ b/2024/src/2024/README.md @@ -1,13 +1,14 @@ # ❄️❄️❄️ Advent of Code 2024 ❄️❄️❄️ -| Day | Title | Code | Tests | Tags | Difficulty | Visual | -|----------------------------------------------|-----------------------|------------------------|------------------------------|---------------------------------------------------|------------|--------| -| [Day 1](https://adventofcode.com/2024/day/1) | Historian Hysteria | [code](day01/day01.ts) | [tests](day01/day01.test.ts) | num list comparison, abs value | 🧊 | | -| [Day 2](https://adventofcode.com/2024/day/2) | Red-Nosed Reports | [code](day02/day02.ts) | [tests](day02/day02.test.ts) | increasing/decreasing num list, deltas | 🧊 | | -| [Day 3](https://adventofcode.com/2024/day/3) | Mull It Over | [code](day03/day03.ts) | [tests](day03/day03.test.ts) | regex, compiler | 🧊 | | -| [Day 4](https://adventofcode.com/2024/day/4) | Ceres Search | [code](day04/day04.ts) | [tests](day04/day04.test.ts) | grid, crosswords | 🧊🧊 | | -| [Day 5](https://adventofcode.com/2024/day/5) | Print Queue | [code](day05/day05.ts) | [tests](day05/day05.test.ts) | graph, topological sort, Kahn's | 🧊🧊🧊 | | -| [Day 6](https://adventofcode.com/2024/day/6) | Guard Gallivant | [code](day06/day06.ts) | [tests](day06/day06.test.ts) | grid, move & turn, detect loops | 🧊🧊 | | -| [Day 7](https://adventofcode.com/2024/day/7) | Bridge Repair | [code](day07/day07.ts) | [tests](day07/day07.test.ts) | equations, combos of + * \|\|, binary and ternary | 🧊🧊 | | -| [Day 8](https://adventofcode.com/2024/day/8) | Resonant Collinearity | [code](day08/day08.ts) | [tests](day08/day08.test.ts) | grid, Manhattan distance | 🧊🧊 | | -| [Day 9](https://adventofcode.com/2024/day/9) | Disk Fragmented | [code](day09/day09.ts) | [tests](day09/day09.test.ts) | disk fragmenting | 🧊🧊🧊 | | +| Day | Title | Code | Tests | Tags | Difficulty | Visual | +|------------------------------------------------|-----------------------|------------------------|------------------------------|---------------------------------------------------|------------|--------| +| [Day 1](https://adventofcode.com/2024/day/1) | Historian Hysteria | [code](day01/day01.ts) | [tests](day01/day01.test.ts) | num list comparison, abs value | 🧊 | | +| [Day 2](https://adventofcode.com/2024/day/2) | Red-Nosed Reports | [code](day02/day02.ts) | [tests](day02/day02.test.ts) | increasing/decreasing num list, deltas | 🧊 | | +| [Day 3](https://adventofcode.com/2024/day/3) | Mull It Over | [code](day03/day03.ts) | [tests](day03/day03.test.ts) | regex, compiler | 🧊 | | +| [Day 4](https://adventofcode.com/2024/day/4) | Ceres Search | [code](day04/day04.ts) | [tests](day04/day04.test.ts) | grid, crosswords | 🧊🧊 | | +| [Day 5](https://adventofcode.com/2024/day/5) | Print Queue | [code](day05/day05.ts) | [tests](day05/day05.test.ts) | graph, topological sort, Kahn's | 🧊🧊🧊 | | +| [Day 6](https://adventofcode.com/2024/day/6) | Guard Gallivant | [code](day06/day06.ts) | [tests](day06/day06.test.ts) | grid, move & turn, detect loops | 🧊🧊 | | +| [Day 7](https://adventofcode.com/2024/day/7) | Bridge Repair | [code](day07/day07.ts) | [tests](day07/day07.test.ts) | equations, combos of + * \|\|, binary and ternary | 🧊🧊 | | +| [Day 8](https://adventofcode.com/2024/day/8) | Resonant Collinearity | [code](day08/day08.ts) | [tests](day08/day08.test.ts) | grid, Manhattan distance | 🧊🧊 | | +| [Day 9](https://adventofcode.com/2024/day/9) | Disk Fragmented | [code](day09/day09.ts) | [tests](day09/day09.test.ts) | disk fragmenting | 🧊🧊🧊 | | +| [Day 10](https://adventofcode.com/2024/day/10) | Hoof It | [code](day10/day10.ts) | [tests](day10/day10.test.ts) | topographic map, bfs, dfs | 🧊🧊 | | diff --git a/2024/src/2024/day10/day10.ts b/2024/src/2024/day10/day10.ts index a8140cb..ebec82a 100644 --- a/2024/src/2024/day10/day10.ts +++ b/2024/src/2024/day10/day10.ts @@ -32,7 +32,7 @@ function calcTrailheadScores(grid: Grid) { while (queue.length > 0) { const current = queue.shift()!; - const currHeight = parseInt(grid.get(current.serialize())!, 10); + const currHeight = Number.parseInt(grid.get(current.serialize())!); for (const neighbor of getNeighborCoords(current)) { const neighborKey = neighbor.serialize(); @@ -40,7 +40,7 @@ function calcTrailheadScores(grid: Grid) { continue; } - const neighborHeight = parseInt(grid.get(neighborKey)!, 10); + const neighborHeight = Number.parseInt(grid.get(neighborKey)!); if (neighborHeight === currHeight + 1) { visited.add(neighborKey); queue.push(neighbor); @@ -81,7 +81,7 @@ function calcTrailheadRatings(grid: Grid) { continue; } - const neighborHeight = parseInt(grid.get(neighborKey)!, 10); + const neighborHeight = Number.parseInt(grid.get(neighborKey)!); if (neighborHeight === currentHeight + 1) { paths += dfsTrailhead(neighbor, neighborHeight); } diff --git a/README.md b/README.md index b82ac40..1e22f38 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Collection of my solutions to the [AoC](https://adventofcode.com/) challenges (2 ## Quick links -- Advent of Code 2️⃣0️⃣2️⃣4️⃣ : [overview](2024/src/2024/README.md) & [solutions](2024/src/2024) - 18 / 50 ⭐️   ![Progress](https://progress-bar.xyz/36/) +- Advent of Code 2️⃣0️⃣2️⃣4️⃣ : [overview](2024/src/2024/README.md) & [solutions](2024/src/2024) - 20 / 50 ⭐️   ![Progress](https://progress-bar.xyz/40/) - Advent of Code 2️⃣0️⃣2️⃣3️⃣ : [overview](2015-2023/src/main/kotlin/aoc2023/README.md) & [solutions](2015-2023/src/main/kotlin/aoc2023) - 50 / 50 ⭐️   ![Progress](https://progress-bar.xyz/100/) - Advent of Code 2️⃣0️⃣2️⃣2️⃣ : [overview](2015-2023/src/main/kotlin/aoc2022/README.md) & [solutions](2015-2023/src/main/kotlin/aoc2022) - 50 / 50 ⭐️   ![Progress](https://progress-bar.xyz/100/) - Advent of Code 2️⃣0️⃣2️⃣1️⃣ : [overview](2015-2023/src/main/kotlin/aoc2021/README.md) & [solutions](2015-2023/src/main/kotlin/aoc2021) - 50 / 50 ⭐️   ![Progress](https://progress-bar.xyz/100/) @@ -19,7 +19,7 @@ Collection of my solutions to the [AoC](https://adventofcode.com/) challenges (2 - Advent of Code 2️⃣0️⃣1️⃣6️⃣ : [overview](2015-2023/src/main/kotlin/aoc2016/README.md) & [solutions](2015-2023/src/main/kotlin/aoc2016) - 50 / 50 ⭐️   ![Progress](https://progress-bar.xyz/100/) - Advent of Code 2️⃣0️⃣1️⃣5️⃣ : [overview](2015-2023/src/main/kotlin/aoc2015/README.md) & [solutions](2015-2023/src/main/kotlin/aoc2015) - 50 / 50 ⭐️   ![Progress](https://progress-bar.xyz/100/) - Total: 468 / 500 ⭐ + Total: 470 / 500 ⭐ ![Progress](https://progress-bar.xyz/94/) AoC screenshot