adventofcode

ray 2022-12-04T13:16:23.066799Z

day 2

πŸŽ‰ 5
ray 2022-12-04T16:40:44.301189Z

I wanted to make the visual more pronounced per part.

πŸŽ‰ 1
borkdude 2022-12-04T16:45:37.008089Z

Did you manage to upload this to github pages yet?

ray 2022-12-04T17:12:09.705549Z

no, I lost the motivation after a few hours of custom domains BS. But I'll look at again tonight. Want to get days 3 and 4 out of the way first.

πŸŽ‰ 1
ray 2022-12-04T16:41:14.997129Z

ok, on to day 3 :)

ray 2022-12-04T16:42:56.606939Z

thanks to @tylerw for the basis of the visuals. I did quite some mods but it was good not to have to worry about the correctness of the results πŸ™πŸΌ

πŸ‘ 1
Luis Santos 2022-12-04T18:09:48.394789Z

Asked GPT to create a clojure program. Quite impressive the fact that it can generate something that "looks" correct.

;; define a function that checks if one range fully contains the other
(defn fully-contains [a b]
  ;; split the two ranges into their start and end points
  (let [[a-start a-end] (map #(Integer/parseInt %) (a/split "-"))
        [b-start b-end] (map #(Integer/parseInt %) (b/split "-"))]
    ;; check if the range a fully contains range b
    (if (and (<= a-start b-start) (>= a-end b-end))
      true
      false)))

;; define a list of section assignment pairs
(def pairs ["2-4,6-8" "2-3,4-5" "5-7,7-9" "2-8,3-7" "6-6,4-6" "2-6,4-8"])

;; initialize a counter variable
(def counter 0)

;; iterate over all pairs of section assignments
(doseq [[i j] (for [i (range (count pairs)) j (range (inc i) (count pairs))] [i j])]
  ;; check if one range fully contains the other
  (if (or (fully-contains (nth pairs i) (nth pairs j))
          (fully-contains (nth pairs j) (nth pairs i)))
    ;; if it does, increment the counter variable
    (inc counter)))

;; print the number of pairs where one range fully contains the other
(println counter)

bhauman 2022-12-04T18:31:49.242919Z

Hey I just want to point out that using read-string is a really good way to parse most of the input text for these problems.

(def data (-> (slurp "src/adv2022/day4/input.txt")
              (string/replace "-" ",")
              (read-string)
              (->> (partition 2) (partition 2))))

πŸ‘ 4
πŸ‘πŸ» 1
πŸ‘πŸΌ 1
πŸ‘πŸ½ 1
πŸ’― 1
ray 2022-12-04T22:02:33.125579Z

in JS I had a horrible hack for day 1

(->> @data
     str/split-lines
     (map (fn [s]
       (let [n (js/parseInt s)]
        (when-not (js/isNaN n) n))))
     (partition-by nil?)
     (keep #(reduce + %)))

ray 2022-12-04T22:03:41.861609Z

but this works perfectly

(->> @data
     str/split-lines
     (map edn/read-string)
     (partition-by nil?)
     (keep #(reduce + %)))

ray 2022-12-04T22:03:56.941459Z

Thanks for the tip!!

1
bhauman 2022-12-04T18:34:00.007829Z

First I place delimiters in the file around the contents

[49-51,31-50
96-99,2-95
2-62,62-98
34-76,10-59
28-83,27-84
...
40-41,41-86]

russmatney 2022-12-04T18:35:45.878639Z

This reminds me of one of my favorite clojure tricks - write data into edn from another program, then just edn/read-string it into clojure's happy place

πŸ‘ 1
bhauman 2022-12-04T18:36:56.133129Z

Yeah I love in general how easy it is to get data in

pez 2022-12-04T19:28:19.526929Z

I split the lines and map read-string over them.

1
bhauman 2022-12-04T18:35:37.034389Z

You don’t need to parseInt or any of these thing just use read-string for just about everything

bhauman 2022-12-04T18:40:09.730289Z

I guess I should just be safe and mention the disclaimer that you shouldn’t use clojure.core/read-string in production apps …

Thierry 2022-12-04T18:42:21.231539Z

I used a macro for the first 3 days

(defmacro adventreader
  [resource]
  `(let [data# (with-open
                [rdr# (io/reader ~resource)]
                 (doall (line-seq rdr#)))]
     data#))

Thierry 2022-12-04T18:42:39.260099Z

and this for today

(string/split-lines
                       (slurp
                        (io/input-stream data))

borkdude 2022-12-04T18:52:33.634309Z

@bhauman why not use clojure.edn/read-string, did you need to parse programs? (I haven't looked at the input)

bhauman 2022-12-04T19:20:16.580599Z

@borkdude I’m just using read-string because it’s fast and easy and part of clojure.core. Perfect for hacking data. clojure.edn/read-string is for real world use cases for certain.

bhauman 2022-12-04T19:21:17.240649Z

@thierry572 read-string parses the input returning integers, lists, vectors etc thus you can skip the parsing step

Thierry 2022-12-04T19:22:49.329179Z

I know, I use it a lot daily, but didnt want to manipulatr the source data first 🀣 just lazy, thanks for the tip tho.

πŸ‘ 1
tschady 2022-12-04T19:26:09.755789Z

I revised my babashka tasks, maybe somebody else will find them useful. Still not library ready, maybe by end of month. Right now hardcoded for my directory structure. Any feedback before make it general? Changes: β€’ modernized to Babashka CLI β€’ tasks take optional -y YYYY -d DD args, which default to this year and today β€’ bb download : saves file locally β€’ bb badges : only 1 total call to AOC instead of 1 per year, and now includes Total stars β€’ bb template creates src/test stubs from Selmer templates for the day β€’ bb go combo: downloads input, creates templates, and opens browser to the day’s pages (on Mac). https://github.com/tschady/advent-of-code/blob/main/bb.edn https://github.com/tschady/advent-of-code/blob/main/script/tasks.clj

πŸ‘ 6
borkdude 2023-01-10T09:59:25.986869Z

@piotr.kaznowski I found the problem that caused this. You should be able to remove the workaround with the current master build:

bash <(curl ) --dev-build --dir /tmp

borkdude 2023-01-10T10:00:09.815649Z

The issue was that the directory wasn't created before untar-ring

2023-01-10T10:10:01.351209Z

@borkdude Cool! Will have a look.

tschady 2022-12-04T19:26:32.492079Z

cc @borkdude @tsulej

❀️ 1
borkdude 2022-12-04T19:30:44.369389Z

Awesome, feel free to send a PR to advent-of-babashka under my github name and add the link to "external resources"

2022-12-04T22:01:42.406669Z

I'm new to pods -- tried to run bb badges and am getting

Message:  Cannot run program "/home/piotr/.local/share/.babashka/pods/repository/retrogradeorbit/bootleg/0.1.9/linux/x86_64/bootleg": error=2, No such file or directory
Threre's no bootleg executable at the location, only manifest.edn file. Before it crashes, it prints:
Downloading pod retrogradeorbit/bootleg (0.1.9)
Successfully installed pod retrogradeorbit/bootleg (0.1.9)
What am I missing here?

borkdude 2022-12-04T22:02:46.734489Z

@piotr.kaznowski Which OS is this?

borkdude 2022-12-04T22:02:52.486339Z

and what architecture?

2022-12-04T22:05:05.955689Z

@borkdude Arch Linux, x86_64

borkdude 2022-12-04T22:08:01.312599Z

ldd /home/piotr/.local/share/.babashka/pods/repository/retrogradeorbit/bootleg/0.1.9/linux/x86_64/bootleg
?

borkdude 2022-12-04T22:08:31.724749Z

cc @retrogradeorbit - might be good to provide a fully static musl compiled binary for bootleg

2022-12-04T22:09:32.034099Z

$ ldd /home/piotr/.local/share/.babashka/pods/repository/retrogradeorbit/bootleg/0.1.9/linux/x86_64/bootleg
ldd: /home/piotr/.local/share/.babashka/pods/repository/retrogradeorbit/bootleg/0.1.9/linux/x86_64/bootleg: No such file or directory

borkdude 2022-12-04T22:10:13.335339Z

aha, so the file doesn't exist at all?

2022-12-04T22:10:48.944669Z

Yes, as I said above: > Threre's no bootleg executable at the location, only manifest.edn file. Before it crashes, it prints:

borkdude 2022-12-04T22:11:12.225579Z

then it's not the issue I suspected it to be

borkdude 2022-12-04T22:12:37.595729Z

This is what I'm seeing:

$ bb -e "(require '[babashka.pods :as pods]) (pods/load-pod 'retrogradeorbit/bootleg \"0.1.9\")"
Downloading pod retrogradeorbit/bootleg (0.1.9)
Successfully installed pod retrogradeorbit/bootleg (0.1.9)
#:pod{:id "pod.retrogradeorbit.bootleg.glob"}

borkdude 2022-12-04T22:13:08.950389Z

I'll also try on ubuntu...

borkdude 2022-12-04T22:14:15.827969Z

can you maybe try the above with:

BABASHKA_PODS_DIR=/tmp bb -e "(require '[babashka.pods :as pods]) (pods/load-pod 'retrogradeorbit/bootleg \"0.1.9\")"

2022-12-04T22:15:24.854509Z

Hmm, that worked with /tmp!

borkdude 2022-12-04T22:15:49.423349Z

On ubuntu it also worked fine for me. Perhaps you could try to wipe the pods directory and try again

2022-12-04T22:17:30.584969Z

It reproduces the erratic behavior.

borkdude 2022-12-04T22:18:02.954979Z

could it be a file system permission thing?

borkdude 2022-12-04T22:19:31.705149Z

you could try to debug locally with https://github.com/babashka/pods - the load call should also work on the JVM

2022-12-04T22:21:15.429439Z

OK, will try, thanks.

2022-12-04T22:35:57.793509Z

(Meanwhile I can hack it with BABASHKA_PODS_DIR : I have my bb script for AoC, wanted to play with the badges -- thanks @borkdude & @tws)

πŸ‘ 1
2022-12-04T22:36:07.753179Z

https://github.com/caseneuve/aoc2022

Crispin 2022-12-04T22:08:35.369759Z

@retrogradeorbit has joined the channel

pez 2022-12-04T00:31:32.858569Z

A demo of using Clojure to solve Advent of Code problems in your editor, using VS Code + #joyride. https://www.youtube.com/watch?v=0rJvOtbJDyI

pez 2022-12-04T00:35:12.994089Z

And the starter template project is a bit updated as well: https://github.com/PEZ/joyride-aoc-2022

2022-12-04T05:18:15.411239Z

Day 4 - solutions

dumrat 2022-12-22T17:18:52.317559Z

(ns aoc2022.day4
  (:require [ :refer [resource]]
            [clojure.string :as str]
            [clojure.set :refer [intersection]]))

(defn data []
  (->> (resource "inputs/day4.txt")
       (slurp)
       (str/split-lines)))

(defn complete-overlap? [[s1 e1 s2 e2]]
  (or (and (<= s1 s2) (>= e1 e2))
      (and (<= s2 s1) (>= e2 e1))))

(defn partial-overlap? [[s1 e1 s2 e2]]
  (not (or (< e1 s2) (> s1 e2))))

(defn solution [overlap?]
  (->> (data)
       (map #(str/split % #","))
       (map (partial map #(str/split % #"-")))
       (map (fn [[[s1 e1] [s2 e2]]]
              (map #(Integer/parseInt %) [s1 e1 s2 e2])))
       (filter overlap?)
       (count)))

(def part1 (partial solution complete-overlap?))
(def part2 (partial solution partial-overlap?))

2022-12-04T08:09:29.480529Z

Oh, filter true? is totally redundant here!

sebastian 2022-12-04T09:49:55.280709Z

I guess there are two types of solutions. 1. comparing numbers of start and end ranges 2. using sets I will always use sets for these types of problems. Feels more flexible and better describable.

pwojnowski 2022-12-04T10:49:05.759679Z

I'm not an algo expert, but the solution with sets is much less optimal, because it... generates sets (time proportional to the sizes of the ranges and space proportional to the set size). This is contrary to the golden rule of algos: Don't compute what is not needed.

sebastian 2022-12-04T10:50:41.391239Z

Of cause I’m not talking about performance. I was talking about what kind of approach comes more naturally.

πŸ‘ 1
carnundotcom 2022-12-04T11:00:22.551099Z

hmm, another 'comparing ranges' answer: https://github.com/CarnunMP/Advent-of-Code/blob/master/src/y2022/d4.clj obvious in hindsight that parsing things into [[a1 b1] [a2 b2]] pairs made things less neat!

carnundotcom 2022-12-04T11:01:57.086889Z

(ooh, weird how the preview renders <= and >= as = πŸ™ƒ)

tschady 2022-12-04T11:31:33.440299Z

same solution as above. Only thing interesting was my helper from previous years: (def input (f/read-ranges "2022/d04.txt")) https://github.com/tschady/advent-of-code/blob/main/src/aoc/2022/d04.clj

πŸ‘ 1
Luis Santos 2022-12-04T11:35:32.567219Z

(defn parse-assignment [a]
  (->> (string/split a #"-|,")
       (map #(Integer/parseInt %))
       (partition 2)
       (map (fn [[a b]] (range a (inc b))))
       (map set)))

(defn subset? [[a b]]
  (or (clojure.set/subset? a b)
      (clojure.set/subset? b a)))

(defn intersection? [[a b]]
  (not (empty? (clojure.set/intersection a b))))

(defn day4 []
  (let [in (slurp "input/day-4-input-1.txt")
        assignments (map parse-assignment (string/split-lines in))
        count-assignments #(count (filter true? %))]
    {:part1 (count-assignments (map subset? assignments))
     :part2 (count-assignments (map intersection? assignments))}))

πŸ‘ 1
Thierry 2022-12-04T12:02:54.812489Z

Nice, very short and clean

πŸ‘ 1
Benjamin 2022-12-04T12:04:16.779179Z

seq instead of not empty

Thierry 2022-12-04T12:05:26.387039Z

Or not-empty https://clojuredocs.org/clojure.core/not-empty

Luis Santos 2022-12-04T12:14:00.775069Z

@thierry572 not-empty would return nil for empty sets. I would have to change my (filter true?) to something else. What's the shortest way of achieving your suggestion?

Thierry 2022-12-04T12:17:23.007779Z

Not at computer atm, what about (filter some? %)

Luis Santos 2022-12-04T12:18:45.849979Z

I would have to change my subset? function to return nil. It would be change for change. I don't see an immediate benefit.

Thierry 2022-12-04T12:44:26.793219Z

Good point. Doesnt seq yield the same result? Maybe (some? (not-empty

Thierry 2022-12-04T12:45:11.099729Z

More then one way to reach Rome with Clojure (or any other language for that matter) 🀣

πŸ‘ 1
2022-12-04T14:08:59.879499Z

This is one of those days that I'm going to now look at how other people did the overlap and contains and realise my solution is dumb... https://github.com/stuartstein777/clj-advent-of-code/blob/master/src/stuartstein777/2022/day4.clj

2022-12-04T14:11:06.990129Z

I too considered sets, that does feel more natural to me, but then thought it was wasteful to generate all thsoe numbers

Luis Santos 2022-12-04T14:11:07.789989Z

This was one of the best solutions i've seen. I always forget that these functions can take more than 2 arities.

(defn fully? [[A B X Y]]
  (or (<= A X Y B) (<= X A B Y)))

(defn partially? [[A B X Y]]
  (or (<= X A Y) (<= A X B)))

πŸ‘ 2
Thierry 2022-12-04T14:13:31.548129Z

@luis559 Using not=

(defn intersection? [[a b]]
  (not= #{} (set/intersection a b)))

Thierry 2022-12-04T14:14:50.978699Z

@qmstuart I started out with sets aswell but ended up using a for loop on the sets with data/diff

sebastian 2022-12-04T14:16:19.833669Z

A lot of good stuff here.

Andrew Byala 2022-12-04T17:34:59.518069Z

I was rereading the solution of a coworker of mine, and I can see now that our overlaps? or partially-overlaps? function can actually be simplified to only compare two terms.

(defn overlaps? [[a b c d]]
  (and (<= a d) (<= c b)))

chucklehead 2022-12-04T18:10:52.317949Z

seems like that would also return true for partial overlaps, e.g. (overlaps? [1 3 2 4]) ?

Casey 2022-12-04T19:10:51.621069Z

https://github.com/Ramblurr/advent-of-code-2022/blob/main/src/aoc/day04.clj#L6-L45 Not very memory efficient, but using range and sets made this day's quite fun

robertfw 2022-12-04T20:38:10.129299Z

the advent of transducers continues:

(defn count-filtered [data pred]
  (count
   (sequence
    (comp (map #(str/split % #","))
          cat
          (map #(str/split % #"-"))
          cat
          (map parse-long)
          (partition-all 4)
          (filter pred))
    data)))

(def input (-> "adventofcode2022/day4.txt"
               io/resource
               slurp
               str/split-lines))

(comment
  ;; part 1
  (count-filtered input (fn [[a b c d]]
                          (or (<= a c d b)
                              (<= c a b d))))

  ;; part 2
  (count-filtered input (fn [[a b c d]]
                          (or (<= a c b)
                              (<= a d b)
                              (<= c a d)
                              (<= c b d)))))

πŸ‘ 1
peterh 2022-12-04T21:25:44.604509Z

Here is mine: https://github.clerk.garden/formsandlines/aoc2022-clojure/commit/c55225cae5766f5c77a35a0002021c0cb5ca2024/src/advent_of_clerk/day_04.html I made an explorative chart at the end to see if there are any interesting patterns in the intersection data (not really πŸ˜•).

nooga 2022-12-05T00:08:32.715499Z

https://github.com/nooga/aoc2022/blob/master/day4.lg

(ns day4)

(defn parse [line]
  (map #(map parse-long (split % "-")) (split line ",")))

(def data (->> "input/day4.txt" slurp lines (map parse)))

(defn contain? [[a b] [c d]]
  (or (and (>= c a) (<= d b)) (and (>= a c) (<= b d))))

(defn in? [a b c] (and (>= b a) (<= b c)))

(defn overlap? [[a b] [c d]]
  (or (in? a c b) (in? a d b) (in? c a d) (in? c b d)))

(defn solve [f]
  (->> data (map (partial apply f)) (filter identity) count))

(println "1:" (solve contain?))
(println "2:" (solve overlap?))

βž• 1
nooga 2022-12-05T00:22:30.666549Z

(my >= and =< only take 2 args 😫)

Apple 2022-12-04T05:26:26.264179Z

;; 202204
(let [d (->> (slurp "src/y2022/input202204")
             (re-seq #"\d+")
             (map parse-long)
             (partition 4))
      f (fn [[a1 a2 b1 b2]]
          (or (<= a1 b1 b2 a2)
              (<= b1 a1 a2 b2)))
      g (fn [[a1 a2 b1 b2]]
          (or (<= a1 b2 a2)
              (<= b1 a2 b2)))]
  (map #(count (filter % d)) [f g]))
;; (464 770)

πŸ‘ 14
πŸ‘πŸΌ 1
mchampine 2022-12-04T06:18:48.753919Z

(def input
  (->> (util/load-lines "resources/day04.data")
       (map #(re-seq #"\d+" %))
       (map util/parse-ints)))

;; Part 1
(defn fully-contains? [[a b c d]]
  (or (<= a c d b)
      (<= c a b d)))

(count (filter fully-contains? input)) ;; 487

;; Part 2
(defn overlap? [[a b c d]] (and (<= a d) (<= c b)))
(count (filter overlap? input)) ;; 849

Andrew Byala 2022-12-04T07:17:36.347439Z

https://github.com/abyala/advent-2022-clojure/blob/main/src/advent_2022_clojure/day04.clj looks similar to most of yours, but as usual I wrote a https://github.com/abyala/advent-2022-clojure/blob/main/docs/day04.md to explain it for the newbies!

πŸ‘ 1
πŸ‘πŸ» 1
jaihindhreddy 2022-12-04T07:46:32.100919Z

After the initial impl, I tried to write a fast non-allocating one, but got a measly 8.1x speedup for a trememdous readability-cost:

;; 988.65Β΅s (+- 54.56Β΅s)
(defn day4 [fs]
  (let [xs (->> (re-seq #"(?:(\d+)-(\d+),(\d+)-(\d+)\n)" fs)
             (mapv #(mapv parse-long (rest %))))
        count-by #(transduce
                    (comp (filter %) (map (constantly 1)))
                    + xs)]
    [(count-by (fn [[a b x y]] (or (<= x a b y) (<= a x y b))))
     (count-by (fn [[a b x y]] (and (>= y a) (<= x b))))]))

;; 121.68Β΅s (+- 7.01Β΅s)
(defn day4b [^String fs]
  (let [add (fn [^long x ^Character c]
              (+ (- (int c) 48) (* 10 x)))
        n (count fs)]
    (loop [i 0, state 0, p1 0, p2 0
           a 0, b 0, x 0, y 0]
      (if (= i n) [p1 p2]
        (let [c (.charAt fs i)]
          (case c
            \newline
            (recur (inc i) 0
              (if (or (<= x a b y) (<= a x y b))
                (inc p1) p1)
              (if (and (>= y a) (<= x b))
                (inc p2) p2)
              0 0 0 0)
            (\- \,)
            (recur (inc i) (inc state) p1 p2 a b x y)
            (case state
              0 (recur (inc i) state p1 p2 (long (add a c))      b                x             y)
              1 (recur (inc i) state p1 p2       a         (long (add b c))       x             y)
              2 (recur (inc i) state p1 p2       a               b         (long (add x c))     y)
                (recur (inc i) state p1 p2       a               b                x      (long (add y c))))))))))

2022-12-04T07:52:33.195929Z

(defn parse [line]
  (->> line (re-seq #"\d+") (map parse-long)))

(defn fully? [[A B X Y]]
  (or (<= A X Y B) (<= X A B Y)))

(defn partially? [[A B X Y]]
  (or (<= X A Y) (<= A X B)))

(defn -main [day]
  (let [input (map parse (file->lines day))
        overlaps (fn [f] (count (filter true? (map f input))))]
    {:part1 (overlaps fully?)
     :part2 (overlaps partially?)}))

πŸ‘ 2
mbjarland 2022-12-08T10:31:14.912209Z

(ns day-04
  (:require [clojure.set :refer [subset?]]))

(defn input []
  (for [line (re-seq #".+" (slurp "../day_04.data"))
        :let [[a b c d] (map parse-long (re-seq #"\d+" line))]]
    [(set (range a (inc b))) (set (range c (inc d)))]))

(defn count-matching [f]
  (count (filter #(apply f %) (input))))

(defn solution-1 []
  (count-matching #(or (subset? %1 %2) (subset? %2 %1))))

(defn solution-2 []
  (count-matching #(or (some %1 %2) (some %2 %1))))

Apple 2022-12-04T05:46:24.180409Z

These are amazing. It takes me longer to understand the question.

First hundred users to get the first star on Day 4:

  1) Dec 04  00:00:16  max-sixty (AoC++)
  2) Dec 04  00:00:32  Luke M
  3) Dec 04  00:00:44  dtinth (AoC++)
  4) Dec 04  00:00:55  nim-ka

😲 3
pwojnowski 2022-12-04T10:21:29.321939Z

I wonder how it is possible to submit the solution in 16s...

Thierry 2022-12-04T11:24:51.327209Z

Seems almost impossible to do this in 16 seconds, it takes longer to read the questions

Thierry 2022-12-04T11:27:38.464699Z

Too bad the answer time is counted from release of the questions and not from when you actually start with them. I am still asleep at 6am.

Luis Santos 2022-12-04T11:54:54.535659Z

That's not what I'm seeing.

jaihindhreddy 2022-12-04T12:08:23.669389Z

@luis559 thats for both stars. OP is about part 1

🀯 2
πŸ‘€ 1
πŸ˜… 1
Thierry 2022-12-04T12:10:13.485019Z

But still, 16 seconds?

jaihindhreddy 2022-12-04T12:13:51.173769Z

Assuming that getting input-data and submitting is automated to a keybinding, a question-comprehesion time of 10s and typing the solution in 6s seems possible to me. Possible, but extremely impressive of course.

jaihindhreddy 2022-12-04T12:17:09.217959Z

With that little time though, there's no way one can read the whole text. But, here are the example-data and the bold (and glowing) question:

2-4,6-8
2-3,4-5
5-7,7-9
2-8,3-7
6-6,4-6
2-6,4-8

In how many assignment pairs does one range fully contain the other?
These are enough to understand the question, and it doesn't seem too outrageous this way.

πŸ‘ 1
tschady 2022-12-04T13:25:55.313299Z

Ruby has a cover? method on Ranges which makes it trivial, but I think for these speeds it’s AI: https://clojurians.slack.com/archives/C0GLTDB2T/p1670047249199679

πŸ‘ 1
Luis Santos 2022-12-04T13:27:39.387069Z

I checked previous years and there were similar speeds for the 2 rounds.

pez 2022-12-04T13:28:33.149959Z

> it doesn't seem too outrageous this way It seems too outrageous to me still. πŸ˜ƒ

βž• 2
πŸ˜„ 1
jaihindhreddy 2022-12-04T13:31:09.656459Z

Indeed @tws, the leader's GitHub https://github.com/max-sixty/aoc-gpt.

Apple 2022-12-04T15:40:07.582309Z

Exactly. HN: https://news.ycombinator.com/item?id=33850999

🀯 1
Casey 2022-12-04T19:22:46.528219Z

There are some nice writeups from past years from folks who placed highly in the leaderboard

πŸ‘ 1
jaihindhreddy 2022-12-04T05:58:48.944219Z

Mine were 5m6s and 6m21s for the two stars resp. It took me ~2m just to read the question xDD.

pyrmont 2022-12-04T06:58:24.600169Z

@coyotesqrl I really like the Clerk-generated pages. What happens if you don't put the visibility metadata before the function definitions? Do you get a list of the vars that are created when you define the function?

pyrmont 2022-12-04T08:00:27.088809Z

That's cool. It's great having the puzzle text right in line, too. It's certainly making me tempted to explore it as an option.

sebastian 2022-12-04T09:52:40.517879Z

I am using it this year but until now there was no benefit from it compared to just using the repl. It just took up more screen real estate. I hope some more visual problems will come soon.

πŸ‘ 1
R.A. Porter 2022-12-04T07:22:24.055819Z

Yep. It's not terrible, but seeing the metadata is less noisy to me than seeing the var definitions. I could apply the metadata to the whole namespace and then change on a per-form basis as needed as well. I might do that on some days.

R.A. Porter 2022-12-04T07:25:54.650429Z

It'll be more useful/interesting if there are any puzzles that lend themselves to interesting accompanying visuals, assuming I can solve them and want to put in the extra effort to create visualizations.