Skip to content

Commit

Permalink
franklin-update
Browse files Browse the repository at this point in the history
  • Loading branch information
rdboyes committed Dec 4, 2024
1 parent 5134b35 commit 4e8c3ab
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions posts/adventofcode2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4e8c3ab

Please sign in to comment.