diff --git a/2022/22/task.ts b/2022/22/task.ts index febce24..6cab54c 100644 --- a/2022/22/task.ts +++ b/2022/22/task.ts @@ -91,8 +91,9 @@ export async function taskTwo(input: string[]): Promise { } const steps = parseInt(test.trim()) for (let j = 0; j < steps; j++) { - if (grid[y+dirY][x+dirX] == '#') break - else if (grid[y+dirY][x+dirX] == ' ') { + if (grid[y+dirY][x+dirX] == '#') { + break + } else if (grid[y+dirY][x+dirX] == ' ') { //console.log('space') //console.log(x,y, dirX, dirY) const [_x, _y, _dirX, _dirY] = newPosDir(x,y, dirX, dirY, sideMap, sideLength) @@ -174,8 +175,8 @@ function entryDir(entry: CubeSide): [number, number] { switch(entry) { case 't': return [0, 1] case 'b': return [0, -1] - case 'r': return [1, 0] - case 'l': return [-1, 0] + case 'r': return [-1, 0] + case 'l': return [1, 0] } } @@ -247,8 +248,6 @@ function getCubeEntrySides(grid: string[][], sideLength: number) { } while(updated) - console.log(sides) - return sides } diff --git a/2022/README.md b/2022/README.md index e39c921..0c1e92d 100644 --- a/2022/README.md +++ b/2022/README.md @@ -1,5 +1,5 @@ # 2022 -![](https://img.shields.io/badge/stars%20⭐-48-yellow) +![](https://img.shields.io/badge/stars%20⭐-50-yellow) ![Metrics](../visuals/github-metrics-2022.svg) diff --git a/README.md b/README.md index eaa3eac..16e91a3 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Whatever I feel like today. But it will most likely either be Java, Python, C++,

2022

-![](https://img.shields.io/badge/stars%20⭐-48-yellow) +![](https://img.shields.io/badge/stars%20⭐-50-yellow)

2021