Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-medina committed Dec 3, 2023
1 parent 3392227 commit 74702dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/internal/app",
"args": ["-day", "3", "-part", "2"],
"args": ["-day", "3", "-part", "1", "-test"],
"cwd": "${workspaceFolder}"
}
]
Expand Down
3 changes: 2 additions & 1 deletion internal/days/Day03/day03.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func gearRatio(e engine) int {
totalParts = totalParts + 1
ratio = ratio * p.value
if totalParts == 2 {
fmt.Printf("gear at (%v,%v) has a ratio of: %v\n", s.row, s.col, ratio)
total += ratio
break
}
Expand All @@ -162,7 +163,7 @@ func adjacent(p possibleNumber, s element) bool {
}
}

// up row
// up or bottom row, should be on the line +-1
if s.row == p.star.row-1 || s.row == p.star.row+1 {
if s.col >= p.star.col-1 && s.col <= p.end.col+1 {
return true
Expand Down

0 comments on commit 74702dc

Please sign in to comment.