Grilled Cheese

ExploreLog inSign up
Terms of UsePrivacy PolicyCommunity StandardsHelpGet the app

Grilled Cheese is a product of Village Compute

Version devBuilt at: 2026-12-03 22:42:33 EST

PhotosVideosAllPeople
LatestRanked
Load more
@mazedlx.bsky.socialDec 3, 2026, 8:00 AM

I just completed "Foggy Forest" - Day 3 - Advent of Code 2026 #AdventOfCode adventofcode.com/2026/day/3

adventofcode.comDay 3 - Advent of Code 2026
@iamharisahsan.bsky.socialDec 3, 2026, 8:00 AM

I just completed "Foggy Forest" - Day 3 - Advent of Code 2026
#AdventOfCode

You want to see the code?
Follow me on GitHub..
github.com/Haris-Mughal

and find code there.. :)

adventofcode.com/2026/day/3

Photo, no description
?Unknown authorDec 3, 2026, 7:59 AM

🎄 #AdventOfCode day 3

It's grid time already! It was fun to solve it in a purely functional way using 🐫 #OCaml ☺️.

I really like that the code for part 2 can be adapted to solve part 1 by removing a *single* character in it.

{
  module T = Set.Make(struct type t = int * int let compare = compare end)
}

rule map trees i j = parse
| '#' { map (T.add (i, j) trees) i (j+1) lexbuf }
| '.' { map trees i (j+1) lexbuf }
| '\n' { map trees (i+1) 0 lexbuf }
| eof { trees }

{
  let ts = map T.empty 0 0 (Lexing.from_channel stdin) in
  let to_check (i, j) = T.(filter (fun (i', j') -> i' <= i && j' > j) ts |> to_list) in
  let is_square (i, j) (i', j') = T.(mem (i+j'-j, j-i'+i) ts && mem (i'+j'-j, j'-i'+i) ts) in
  let (+^) n b = n + Bool.to_int b in
  let count_squares t = List.(map (is_square t) (to_check t) |> fold_left (+^) 0) in
  Printf.printf "%d\n" List.(map count_squares (T.elements ts) |> fold_left (+) 0)
}
@evargalo.bsky.socialDec 3, 2026, 7:49 AM

For people who like to code without IAGen, #AdventOfCode is still very fun !

I've completed "Foggy Forest" - Day 3 - Advent of Code 2026 adventofcode.com/2026/day/3

adventofcode.comDay 3 - Advent of Code 2026
@wayoshi.bsky.socialDec 3, 2026, 7:46 AM

I've completed "Foggy Forest" - Day 3 - Advent of Code 2026 #AdventOfCode adventofcode.com/2026/day/3

Definitely overengineered this one with exact calculations, I'm sure there's a shortcut / more elegant way to calculate these corners.

topaz.github.iopaste
@bazraubach.bsky.socialDec 3, 2026, 7:44 AM

"Foggy Forest" - Day 3 - Advent of Code 2026 #AdventOfCode
I'll have to go back to part 2 later as my current solution is a bit slow (few seconds). I also want to make a visualization.

adventofcode.com/2026/day/3

adventofcode.comDay 3 - Advent of Code 2026
@erickmerchant.bsky.socialDec 3, 2026, 7:37 AM

I've completed "Fulminating Farmland" - Day 2 - Advent of Code 2026 #AdventOfCode adventofcode.com/2026/day/2

adventofcode.comDay 2 - Advent of Code 2026
@pandamorningyawn.comDec 3, 2026, 7:25 AM

oh god i did day 2 part 2 in the most back assward way possible. i am absolutely not pushing this to my repo until i can make it not fugly and asinine. so embarassing.

but it worked.

I just completed "Fulminating Farmland" - Day 2 - Advent of Code 2026 #AdventOfCode adventofcode.com/2026/day/2

adventofcode.comDay 2 - Advent of Code 2026
E@emurphy.bsky.socialDec 3, 2026, 7:23 AM

I just completed "Foggy Forest" - Day 3 - Advent of Code 2026 #AdventOfCode adventofcode.com/2026/day/3

adventofcode.comDay 3 - Advent of Code 2026
@xavd.idDec 3, 2026, 7:19 AM

Post for #AdventOfCode day 2 in #python is up! I thought about staying up to do part 3 but then took a look at it and decided it was a tomorrow problem. 🙈

advent-of-code.xavd.id/writeups/202...

advent-of-code.xavd.idAdvent of Code 2026 Day 2: Fulminating FarmlandA step-by-step Python walkthrough for solving Advent of Code 2026 Day 2.
@neil-vass.comDec 3, 2026, 7:18 AM

Trying to do Advent of Code on a Commodore 64, my main complaint so far has been a lack of unit testing.

I'm delighted that I've now fixed that problem! It's a very basic testing system ... but it works, and even has cheerful colours and symbols on the summary.

#AdventOfCode

Commodore 64 screen, with big blocky text all in capitals. It has a set of test cases, and the result of running them - including pass announcements in green with hearts, and fails in red with a big cross.
@jeantessier.comDec 3, 2026, 7:07 AM

I just completed "Foggy Forest" - Day 3 - Advent of Code 2026 #AdventOfCode adventofcode.com/2026/day/3

See my #Ruby solution at github.com/jeantessier/...

adventofcode.comDay 3 - Advent of Code 2026
@jahinzee.netDec 3, 2026, 6:46 AM

I've completed Part One of "Foggy Forest" - Day 3 - Advent of Code 2026 #AdventOfCode adventofcode.com/2026/day/3

Part Two is kicking my ass

adventofcode.comDay 3 - Advent of Code 2026
@thoughtfulnz.bsky.socialDec 3, 2026, 6:40 AM

Day 3 #AdventOfCode in #rstats. I liked my star 1 solution, based on possible edge distances, but part 2 was just a brute force of valid edges with for loops because I couldn't think of anything clever to do with it. Code (barely fits) in alt text

# For a given #A....#B in a row it is a square if 
# A = (r,c) B = (r,c+d) C = (r+d,c) D = (r+d,c+d) where D = Ac - Bc
input = readLines("input.txt")
# Build logical grid
grid <- do.call(
  rbind,
  lapply(
    input,
    function(x) strsplit(x, "", fixed = TRUE)[[1]] == "#"
  )
)
n_rows <- nrow(grid)
n_cols <- ncol(grid)
square_count <- 0
for (d in 1:140) { #140 is max gap
  # rows participating in a square of edge d
  upper_rows <- seq_len(n_rows - d)
  lower_rows <- upper_rows + d
  # columns participating in a square of edge d
  left_cols  <- seq_len(n_cols - d)
  right_cols <- left_cols + d
  #if hypothetical squares exist increase count
  square_count <- square_count +
    sum(
      grid[upper_rows, left_cols,  drop = FALSE] &
        grid[upper_rows, right_cols, drop = FALSE] &
        grid[lower_rows, left_cols,  drop = FALSE] &
        grid[lower_rows, right_cols, drop = FALSE]
    )
}
square_count
#Star2
trees <- which(grid, arr.ind = TRUE)
n_trees <- nrow(trees)
square_count <- 0L
for (i in seq_len(n_trees - 1)) {
  r1 <- trees[i, 1]
  c1 <- trees[i, 2]
  for (j in (i + 1):n_trees) {
    r2 <- trees[j, 1]
    c2 <- trees[j, 2]
    dx <- r2 - r1
    dy <- c2 - c1
    # 1st direction
    r3 <- r1 - dy
    c3 <- c1 + dx
    r4 <- r2 - dy
    c4 <- c2 + dx
    if (
      r3 >= 1 && r3 <= n_rows &&
      r4 >= 1 && r4 <= n_rows &&
      c3 >= 1 && c3 <= n_cols &&
      c4 >= 1 && c4 <= n_cols
    ) {
      if (
        grid[r3, c3] &&
        grid[r4, c4]
      ) {
        square_count <- square_count + 1L
      }
    }
    # other direction
    r3 <- r1 + dy
    c3 <- c1 - dx
    r4 <- r2 + dy
    c4 <- c2 - dx
    if (
      r3 >= 1 && r3 <= n_rows &&
      r4 >= 1 && r4 <= n_rows &&
      c3 >= 1 && c3 <= n_cols &&
      c4 >= 1 && c4 <= n_cols
    ) {
      if (
        grid[r3, c3] &&
        grid[r4, c4]
      ) {
        square_count <- square_count + 1
      }
    }
  }
}
# squares not edges
square_count <- square_count %/% 4
square_count
@butakun.bsky.socialDec 3, 2026, 6:39 AM

visualization, day 3, 2026 #adventofcode

@ebersole.devDec 3, 2026, 6:35 AM

Day 3 of #adventofcode done.

The first 2d grid puzzle of the year always takes me a bit to reawaken that part of my brain.

My solution isn't pretty, but it worked.

P1 in 44 mins, p2 in 93 mins.

@cybermaxs.bsky.socialDec 3, 2026, 6:29 AM

I've completed "Foggy Forest" - Day 3 - Advent of Code 2026 #AdventOfCode adventofcode.com/2026/day/3 using tricky SQL JOINs

read it here sqldojo.dev/q/shop/1lVJB...

adventofcode.comDay 3 - Advent of Code 2026
@nolokor.bsky.socialDec 3, 2026, 6:20 AM

I just completed "Foggy Forest" - Day 3 - Advent of Code 2026 #AdventOfCode adventofcode.com/2026/day/3

My dirty solution in Elixir: github.com/AlexanderPol...
I feel like I need to figure out how to write it more concise, master recursion and matching.

adventofcode.comDay 3 - Advent of Code 2026
@pkitslaar.bsky.socialDec 3, 2026, 6:15 AM

I just completed "Foggy Forest" - Day 3 - Advent of Code 2026 #AdventOfCode adventofcode.com/2026/day/3

adventofcode.comDay 3 - Advent of Code 2026
?Unknown authorDec 3, 2026, 6:14 AM

I just completed "Foggy Forest" - Day 3 - Advent of Code 2026

Part 1 was straightforward, although my solution was lazy. Part 2 ughhh. I hate these grid problems. First I tried to calculate things with math.dist from a center point. Not smart enough. Ended up rotating every square.

#AdventOfCode