Skip to content

Commit

Permalink
finish 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
Kr0nox committed Dec 29, 2023
1 parent 81421ce commit fa59967
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions 2022/22/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ export async function taskTwo(input: string[]): Promise<void> {
}
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)
Expand Down Expand Up @@ -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]
}
}

Expand Down Expand Up @@ -247,8 +248,6 @@ function getCubeEntrySides(grid: string[][], sideLength: number) {

} while(updated)

console.log(sides)

return sides
}

Expand Down
2 changes: 1 addition & 1 deletion 2022/README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Whatever I feel like today. But it will most likely either be Java, Python, C++,

<h3><a href="2022/README.md">2022</a></h3>

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

<h3><a href="2021/README.md">2021</a></h3>

Expand Down

0 comments on commit fa59967

Please sign in to comment.