This commit is contained in:
2024-12-04 18:33:46 +02:00
parent 65eafb1d56
commit 43fcaef247

View File

@@ -80,6 +80,25 @@ func main() {
} }
} }
} }
if lines[y][x] == 'A' {
if y >= 1 && y < h-1 && x >= 1 && x < w-1 {
check := string([]byte{lines[y-1][x-1], lines[y-1][x+1], lines[y+1][x-1], lines[y+1][x+1]})
if check == "MSMS" {
p2++
}
if check == "SMSM" {
p2++
}
if check == "MMSS" {
p2++
}
if check == "SSMM" {
p2++
}
}
}
} }
} }