mirror of
https://github.com/onyx-and-iris/aoc2023.git
synced 2024-11-22 02:10:48 +00:00
check pass for single digit
This commit is contained in:
parent
c9ea61c7f4
commit
df7fa4b973
10
day-3/two.go
10
day-3/two.go
@ -12,12 +12,10 @@ func getGearRatio(row, col int) (int, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, enginePart := range engineParts[i] {
|
for _, enginePart := range engineParts[i] {
|
||||||
for _, part := range enginePart.digits {
|
for _, digit := range enginePart.digits {
|
||||||
if part.col == col-1 || part.col == col || part.col == col+1 {
|
if digit.pass && digit.col == col-1 || digit.col == col || digit.col == col+1 {
|
||||||
if anyTrue(enginePart.digits) {
|
partsConsidered = append(partsConsidered, enginePart)
|
||||||
partsConsidered = append(partsConsidered, enginePart)
|
break
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user