diff --git a/2024/bonus/day04/check_point/main.tf b/2024/bonus/day04/check_point/main.tf index 54450c4..af95b21 100644 --- a/2024/bonus/day04/check_point/main.tf +++ b/2024/bonus/day04/check_point/main.tf @@ -22,8 +22,6 @@ locals { "UL" = [-1, -1] "U" = [0, -1] "UR" = [1, -1] - "L" = [-1, 0] - "R" = [1, 0] "DL" = [-1, 1] "D" = [0, 1] "DR" = [1, 1] diff --git a/2024/bonus/day04/main.tf b/2024/bonus/day04/main.tf index b7d8b18..0a80075 100644 --- a/2024/bonus/day04/main.tf +++ b/2024/bonus/day04/main.tf @@ -6,6 +6,9 @@ locals { grid = split("\n", chomp(var.input)) height = length(local.grid) width = length(local.grid[0]) + + lr = length(regexall("XMAS", var.input)) + rl = length(regexall("SAMX", var.input)) } module "check_point" { @@ -20,7 +23,7 @@ module "check_point" { } output "part1" { - value = sum(module.check_point[*].xmas) + value = sum(module.check_point[*].xmas) + local.lr + local.rl } output "part2" {