From 4e8c3ab33216c1e3c91fd857a363f44835363924 Mon Sep 17 00:00:00 2001 From: Randy Boyes Date: Wed, 4 Dec 2024 09:57:23 -0500 Subject: [PATCH] franklin-update --- posts/adventofcode2024.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/posts/adventofcode2024.md b/posts/adventofcode2024.md index 2939c8e..ea14fe1 100644 --- a/posts/adventofcode2024.md +++ b/posts/adventofcode2024.md @@ -138,10 +138,20 @@ nl = length(text) ts = split.(text, "") fb = text + ud = reduce(*, reduce(hcat, ts), dims = 2) -diag1 = [[ts[x][y] for (x, y) in Iterators.product(1:nl, 1:nl) if x + y == z] for z in 2:(nl*2)] -diag2 = [[ts[x][y] for (x, y) in Iterators.product(1:nl, 1:nl) if x - y == z] - for z in (nl-1):-1:(-(nl-1))] + +diag1 = [ + [ts[x][y] for (x, y) in + Iterators.product(1:nl, 1:nl) if x + y == z] + for z in 2:(nl*2) +] + +diag2 = [ + [ts[x][y] for (x, y) in + Iterators.product(1:nl, 1:nl) if x - y == z] + for z in (nl-1):-1:(-(nl-1)) +] function str_count_overlap(column, pattern::Union{String,Regex}; overlap::Bool=false) if ismissing(column)