adventofcode

nbardiuk 2023-12-01T07:16:10.950789Z

Day 1 - Solutions 🧵

nbardiuk 2023-12-01T07:16:44.031579Z

https://github.com/nbardiuk/adventofcode/blob/master/2023/src/day01.clj Had to google how to make overlapping regex

👀 5
😀 1
Sam Ferrell 2023-12-01T07:17:55.696919Z

https://github.com/samcf/advent-of-code/blob/main/2023-01-trebuchet.clj Got frustrated with regex and resorted to index-of and last-index-of

👍 4
😍 2
Ellis 2023-12-01T07:18:06.796549Z

https://elken.github.io/aoc/src/solutions/2023/day01/

👍 2
👍🏼 1
👀 1
Ben Sless 2023-12-11T06:57:52.471599Z

Coming late to the party, but I decided to abuse strings and regexes

(defn reverse-charseq
  ^CharSequence [^CharSequence cs]
  (let [len (.length cs)
        n (unchecked-dec-int len)]
    (reify CharSequence
      (length [_] (.length cs))
      (subSequence [_ from to]
        (reverse-charseq
         (.subSequence cs (unchecked-subtract-int len to) (unchecked-subtract-int len from))))
      (charAt [_ i] (.charAt cs (unchecked-subtract-int n i)))
      (toString [this]
        (.toString (StringBuilder. ^CharSequence this))))))
This solves the problem of the overlapping regexes by allowing me to search for the reversed pattern on the string without allocating a new string, terrible idea 😄

vollcheck 2023-12-01T09:53:08.947899Z

re-seq + (juxt first last) to the rescue 😉 https://github.com/vollcheck/aoc/blob/master/src/y23/day01.clj

👍 2
❤️ 1
borkdude 2023-12-01T10:26:46.868059Z

My solution in #squint : https://squint-cljs.github.io/squint/?boilerplate=https%3A%2F%2Fgist.githubusercontent.com%2Fborkdude%2Fcf94b492d948f7f418aa81ba54f428ff%2Fraw%2Fa7da6236e9670681a93761b81fd66ad26c119164%2Faoc_ui.cljs&repl=true&src=OzsgSGVscGVyIGZ1bmN0aW9uczoKOzsgKGZldGNoLWlucHV0IHllYXIgZGF5KSAtIGdldCBBT0MgaW5wdXQKOzsgKGFwcGVuZCBzdHIpIC0gYXBwZW5kIHN0ciB0byBET00KOzsgKHNweSB4KSAtIGxvZyB4IHRvIGNvbnNvbGUgYW5kIHJldHVybiB4CgooZGVmIGlucHV0ICgtPj4gKGpzLWF3YWl0IChmZXRjaC1pbnB1dCAyMDIzIDEpKQogICAgICAgICAgICAgc3RyL3RyaW0KICAgICAgICAgICAgIHN0ci9zcGxpdC1saW5lcykpCgooZGVmbiBkaWdpdHMgW3NdCiAgKHZlYyAoa2VlcCBwYXJzZS1sb25nIHMpKSkKCihkZWZuIGZpcnN0LWFuZC1sYXN0LWRpZ2l0cyBbZGlnaXRzXQogIChzdHIgKGZpcnN0IGRpZ2l0cykgKGxhc3QgZGlnaXRzKSkpCgooY29tbWVudAogICgtPiAoZGlnaXRzICJhMWIyIikKICAgIChmaXJzdC1hbmQtbGFzdC1kaWdpdHMpCiAgICBwYXJzZS1sb25nKQogICkKCihkZWZuIHBhcnQtMQogIFtpbnB1dF0KICAoLT4%2BIGlucHV0CiAgICAobWFwIGRpZ2l0cykKICAgIChtYXAgKGNvbXAgcGFyc2UtbG9uZyBmaXJzdC1hbmQtbGFzdC1kaWdpdHMpKQogICAgKGFwcGx5ICspKSkKCihjb21tZW50CiAgKHBhcnQtMSBpbnB1dCkpCgooZGVmIHdvcmQtPmRpZ2l0IHsib25lIiAxCiAgICAgICAgICAgICAgICAgICJ0d28iIDIKICAgICAgICAgICAgICAgICAgInRocmVlIiAzCiAgICAgICAgICAgICAgICAgICJmb3VyIiA0CiAgICAgICAgICAgICAgICAgICJmaXZlIiA1CiAgICAgICAgICAgICAgICAgICJzaXgiIDYKICAgICAgICAgICAgICAgICAgInNldmVuIiA3CiAgICAgICAgICAgICAgICAgICJlaWdodCIgOAogICAgICAgICAgICAgICAgICAibmluZSIgOX0pCgooZGVmIHJlCiAgOzsgZm9yIGxhY2sgb2YgcmUtcGF0dGVybgogIChuZXcganMvUmVnRXhwCiAgICAoc3RyIChzdHIvam9pbiAifCIgKGtleXMgd29yZC0%2BZGlnaXQpKSAifFxcZCIpKSkKCihkZWZuIG1hdGNoLW92ZXJsYXBwaW5nCiAgInJlLXNlcSB3aXRoIG92ZXJsYXAiIAogIFtyZSBzXQogIChsb29wIFttYXRjaGVzIFtdCiAgICAgICAgIHMgc10KICAgIChpZi1sZXQgW21hdGNoIChyZS1maW5kIHJlIHMpXQogICAgICAocmVjdXIKICAgICAgICAgIChjb25qIG1hdGNoZXMgbWF0Y2gpCiAgICAgICAgKHN1YnMgcyAoaW5jICguaW5kZXhPZiBzIG1hdGNoKSAyKSkpCiAgICAgICh2ZWMgbWF0Y2hlcykpKSkKCihjb21tZW50CiAgKHZlYyAobWF0Y2gtb3ZlcmxhcHBpbmcgcmUgIm9uZTF0d294dGhyZWU0ZWlnaHR3byIpKSkKCihkZWZuIGRpZ2l0cysgW3NdCiAgKG1hcHYgIyhvciAoZ2V0IHdvcmQtPmRpZ2l0ICUpIChwYXJzZS1sb25nICUpKQogICAgKG1hdGNoLW92ZXJsYXBwaW5nIHJlIHMpKSkKCihjb21tZW50CiAgKC0%2BIChkaWdpdHMrICJ0d28xbmluZSIpCiAgICBmaXJzdC1hbmQtbGFzdC1kaWdpdHMKICAgIHBhcnNlLWxvbmcpCiAgKQoKKGRlZm4gcGFydC0yCiAgW2lucHV0XQogICgtPj4gaW5wdXQKICAgIChtYXB2IGRpZ2l0cyspCiAgICAobWFwdiBmaXJzdC1hbmQtbGFzdC1kaWdpdHMpCiAgICAobWFwdiBwYXJzZS1sb25nKQogICAgKGFwcGx5ICspKSkKCihjb21tZW50CiAgKGRlZiBpbnB1dCogKHN0ci9zcGxpdC1saW5lcyAidHdvMW5pbmUKZWlnaHR3b3RocmVlCmFiY29uZTJ0aHJlZXh5egp4dHdvbmUzZm91cgo0bmluZWVpZ2h0c2V2ZW4yCnpvbmVpZ2h0MjM0CjdwcXJzdHNpeHRlZW4iKSkKICAocGFydC0yIGlucHV0KQogICk%3D

👍 3
genmeblog 2023-12-01T10:48:07.524809Z

first day first problems with understanding of the task... anyway, the solution: https://github.com/genmeblog/advent-of-code/blob/master/src/advent_of_code_2023/day01.clj

👍 1
vollcheck 2023-12-01T10:48:32.527259Z

first day first problems with understanding of the task...I had the same feeling 🙂

borkdude 2023-12-01T10:49:28.980199Z

The overlapping regex thing sure was tricky ;)

☝️ 1
1
vollcheck 2023-12-01T10:52:58.561909Z

I definitely need to read not only descriptions but test data more carefully...

oyakushev 2023-12-01T11:31:50.340659Z

Here's what happens when you are dumb and don't know about overlapping regexes https://gist.github.com/alexander-yakushev/06485fe945e30691a1f4d0c87be1f4d9

👍 1
❤️ 2
2023-12-01T13:03:14.599869Z

It never occurred to me until now to put an entire regex into a zero-width lookahead/lookbehind.

2023-12-01T13:03:32.276269Z

When I saw it, I actually thought it might be invalid syntax lol

vollcheck 2023-12-01T13:04:46.910989Z

I guess there's lot more things that Eric want to teach us about this year 😛

2023-12-01T13:05:38.830979Z

I suppose it's that with the outer capture group that makes it work

borkdude 2023-12-01T13:24:06.269209Z

I like the pragmatic idiot-solution driven approach instead of trying to be elegant today ;)

tschady 2023-12-01T13:30:10.106749Z

maybe the strategy is reduce server costs by losing your audience day 1

😆 2
tschady 2023-12-01T13:31:43.485059Z

in total anger, my first pass was munging the number-words to duplicate the last character so I could destructively replace. “eight” -> “eightt”

✅ 1
tschady 2023-12-01T13:33:38.282559Z

second pass looks almost identical to others here. https://github.com/tschady/advent-of-code/blob/main/src/aoc/2023/d01.clj

👍 4
👍🏼 1
oyakushev 2023-12-01T14:03:21.870059Z

@tws Same sentiment, really. I got irrationally angry over AoC today. I rallied up a bunch of friends for it this year and promised that it's gonna start easy, and the very first day is such a newbie-destroyer.

borkdude 2023-12-01T14:03:50.061159Z

That was my feeling too. Day 1 should be a give-away

vollcheck 2023-12-01T14:07:03.831049Z

do you think it's the Eric way of defending against the continuously rising AI tooling?

borkdude 2023-12-01T14:07:44.797219Z

Well, to be honest, this is what you can expect from the rest of AoC, there's always an angry throw-keyboard-out-of-window thing in there ;)

oyakushev 2023-12-01T14:10:53.261849Z

Yeah, it's usually like that, and it's all fine and dandy. Just pulling that out day 1 will shoot a lot of unfamiliar folks down.

👍 3
nbardiuk 2023-12-01T14:12:01.387529Z

Today task is easy for an approach when one iterates over indexes and check if there is a word at that position. I've noticed that Jonathan Paulson was lucky and didn't even notice edge cases https://www.youtube.com/watch?v=rnidYOt9m2o

vollcheck 2023-12-01T14:14:25.857799Z

yup, I guess we (me for sure) got kinda tricked by the Clojure that encourages to treat everything as a collection to apply functions over in compare to Python when you have more imperative way of thinking

2023-12-01T14:19:42.124859Z

> pragmatic idiot-solution driven I think I should put this on my linked in

😂 3
tschady 2023-12-01T14:28:38.175729Z

looks like 37% of people gave up on part2 (or went to bed).

1  46999  27759 

borkdude 2023-12-01T15:05:02.311899Z

Oh I didn't even think about this edge case:

blah7foo is 77
but I guess it just worked because I did first and last on a vector (with a single element)

😏 1
Sam H 2023-12-01T15:11:23.549449Z

ended up getting frustrated with the tricky eightwo case and ended up replacing all the words with the digit wrapped in words 😅 eight8eight

😂 2
😆 2
muthui shere 2023-12-01T15:15:34.201299Z

https://github.com/muthuishere/advent-of-code-clojure-2023. Did a livestream as well https://www.youtube.com/watch?v=15DdYethJHg. Part2 is definitely not a day 1 problem !!! https://www.youtube.com/watch?v=q60gepcBaZs My code No regex , a plain stuff

(def text-digits ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine"])
(defn is-string-a-number [inp]
  (not= nil (parse-long inp)))

(defn text-to-number [input]
  (str (inc (.indexOf text-digits input))))

(defn get-position-info-at-index [index input text-digit]
  (if (str/index-of input text-digit index)
    {:text-digit text-digit :index (str/index-of input text-digit index) :digit-to-be-replaced (text-to-number text-digit) }
    nil))

(defn get-position-info [input text-digit]
  (let [first-index (str/index-of input text-digit)
        last-index   (str/last-index-of input text-digit)]
    (if (not= first-index last-index)
      [(get-position-info-at-index 0 input text-digit) (get-position-info-at-index (dec last-index)  input text-digit)]
      [(get-position-info-at-index 0 input text-digit)])))

(defn get-all-position-data [currentline]
  (->> text-digits
       (map #(get-position-info currentline %1))
       (flatten)
       (filter not-empty)
       (sort-by :index  #(compare %2 %1))))

(defn replace-input-with[input position-info]
  (let [index (get position-info :index)
        digit-to-be-replaced (get position-info :digit-to-be-replaced)]
    (str (.substring input 0 index) digit-to-be-replaced  (.substring input (inc index) ))))

(defn convert-text-digit-to-normal-digit [input]
  (reduce #(replace-input-with %1 %2)
             input (get-all-position-data input)))

(defn first-and-last [inp]
  (let [first-one (first inp)
        last-one (last inp)]
    [first-one last-one]))

(defn calibrate [input]
  (->> input
       (convert-text-digit-to-normal-digit)
       (map str)
       (filter is-string-a-number)
       (first-and-last)
       (reduce  str)
       (parse-long)))

(defn read-as-array-from-classpath [filename]
  (->> filename
       (io/resource)
       (slurp)
       (str/split-lines)))

(defn find-total-calibration-value-in [filename]
  (->> filename
       (read-as-array-from-classpath)
       (map calibrate)
       (filter #(some? %1))
       (reduce +)))

(comment

  (find-total-calibration-value-in "original.txt")
  (find-total-calibration-value-in "sample.txt"))

🎉 2
2023-12-01T15:19:33.130069Z

I'm more annoyed by having to hunt edge cases in a thousand-line file. Including it in the examples in a less subtle way would've been nice 🙂

👍 2
j4m3s 2023-12-01T15:24:53.680269Z

kinda curious, did any of you figure out the overlapping regexes from the explanation or from trying it out ?

Sam H 2023-12-01T15:26:14.803439Z

for me it was running the code on the second sample and then double checking why the answer was out

tschady 2023-12-01T15:27:59.885009Z

whenever I hit these problems I scrutinize the examples, caught eightwothree eventually.

👍 1
tschady 2023-12-01T15:29:17.059859Z

tho at first I put in 10-19 after I saw

7pqrstsixteen

Sam H 2023-12-01T15:35:09.529239Z

yeah, I was thrown off by the sixteen but then searched my input for teen but didn't see anything. Then re-read the instructions finally 😄

fingertoe 2023-12-01T15:57:56.433519Z

I need to brush up on my regex. Got lazy and did some silly string reverse regex to get the answer to #2, so I could go to bed.

borkdude 2023-12-01T15:58:44.664189Z

that's actually not too bad a solution, maybe performance-wise even faster

liebs 2023-12-01T16:04:20.072569Z

I'm relieved to see other people finding the lookaround regex solution a pain 😅

fingertoe 2023-12-01T16:05:45.999569Z

@j4m3s I got a pretty good hint because I originally had a used map to string replace the strings with digits. Because the map was in random order, I got lucky and saw the eigh2. If the map had had eight first, it wouldn’t have been so intuitive that the same problem was happening at the end on my full dataset. I had it passing the example data, but not my full data.

👍 2
jurjanpaul 2023-12-01T16:07:57.609409Z

This time I imagined the overlap edge case as soon as I read part 2, before encountering any evidence of its occurrence. Experience, I guess. I was lucky to quickly find an example of expressing the regex for overlapping matches, which I definitely did not know by heart. TIL (?=...). Only later did I think of the sensible reverse regex approach.

maleghast 2023-12-01T16:51:20.491639Z

I just used clojure.string/replace with a list of potential overlaps coming first in the | list in the regex, because I don't get overlapping regexes. I only did that once I realised that the overlapping edge-case was being enforced. I thought it was a pretty crappy thing to not explain explicitly

➕ 1
maleghast 2023-12-01T16:52:08.550949Z

Like this:

(defn numbers-as-text-to-digits
  "Convert text expressions of numbers 1-9 into string digits"
  [input-string]
  (str/replace
   input-string
   #"oneight|threeight|fiveight|nineight|twone|eightwo|eighthree|sevenine|one|two|three|four|five|six|seven|eight|nine"
   {"oneight" "18"
    "threeeight" "38"
    "fiveight" "58"
    "nineight" "98"
    "twone" "21"
    "eightwo" "82"
    "eighthree" "83"
    "sevenine" "79"
    "one" "1"
    "two" "2"
    "three" "3"
    "four" "4"
    "five" "5"
    "six" "6"
    "seven" "7"
    "eight" "8"
    "nine" "9"}))

1
maleghast 2023-12-01T16:53:15.100589Z

I accept that it only "works" because there are a very limited number of overlaps that are possible because of how the words for numbers are spelled,

jurjanpaul 2023-12-01T16:53:36.122169Z

I like how pragmatic that is!

🙇 1
maleghast 2023-12-01T16:53:53.122309Z

Thanks 🙂

maleghast 2023-12-01T16:58:25.104639Z

Also, I've just spotted a typo that means that threeight is not one of the overlaps in the input data as I got the correct answer despite matching on threeeight (incorrectly)

maleghast 2023-12-01T16:58:46.051819Z

facepalm

maleghast 2023-12-01T16:58:50.025389Z

Ah well

wevrem 2023-12-01T17:13:24.598869Z

what about triplets like eightwone? Or even fiveightwone? Maybe they don’t show in the input data?

maleghast 2023-12-01T17:14:48.904089Z

The first and last words will be matched by the primitive words in the | list

borkdude 2023-12-01T17:14:50.556699Z

that doesn't matter probably since you only need to discover the first and last?

maleghast 2023-12-01T17:15:15.686579Z

What @borkdude said 🙂

borkdude 2023-12-01T17:16:02.431069Z

(I'm pretty confused about this the minute I said it haha)

maleghast 2023-12-01T17:16:41.347939Z

FWIW @borkdude, I ❤️ your part1 digit sieve, using keep and parse-long Mine was similar but far less beautiful

❤️ 1
Ryan Martin 2023-12-01T17:16:56.717099Z

what?!! didn't know overlapping regex was possible... all I could think of was regex with a reversed string (re-seq #"\d|eno|owt|eerht|ruof|evif|xis|neves|thgie|enin") 🤣

j4m3s 2023-12-01T17:17:01.973569Z

oh yeah, just figured that we don't need regexes per se, just prefix/suffix match 😮

2023-12-01T17:17:32.441849Z

yeah reversing crossed my mind too

2023-12-01T17:17:35.136199Z

but I'm too lazy

maleghast 2023-12-01T17:17:55.678369Z

@james.landrein - Please go into detail, I wish to learn and what you said there ^^ makes no sense to me 🙂

j4m3s 2023-12-01T17:18:38.582759Z

like eightwothree you only need first and last, so you could match first string from the beginning with exact string, and same from the end of the string ?

maleghast 2023-12-01T17:19:00.631659Z

Oh I see what you mean, yes. That I understaood

j4m3s 2023-12-01T17:19:02.584149Z

Just an idea on top of my head tho, haven't tested ~

genmeblog 2023-12-01T17:20:07.175089Z

One of the most interesting approaches I've seen today was replacing one with o1e, two with t2o and so on. Then just extract digits.

🤯 6
maleghast 2023-12-01T17:20:11.554439Z

The problem with overlaps between just two words for numbers is that there are a handful that share a letter and because the match on the first wipes out the match on the second you have to match twone and eighthree and so on as separate options in the regex

j4m3s 2023-12-01T17:20:55.106059Z

yeah but technically you don't really need regexes since it's an exact string match 🙂

j4m3s 2023-12-01T17:21:19.258689Z

(it is much easier to write though, so that's what I did )

2023-12-01T17:21:19.696019Z

the numbers aren't exactly at the end or beginning, so you have to compensate for that somehow

maleghast 2023-12-01T17:21:23.694489Z

@tsulej I saw that on a Python-based solutions thread after I'd finished (was looking around to see how people had done it out of curiosity) and I couldn't figure out how that would handle two word overlaps.

👍 1
borkdude 2023-12-01T17:21:54.219519Z

the first puzzle drives you to regex and then the second puzzle punishes you for choosing that direction, very AOC

☝️ 3
1
maleghast 2023-12-01T17:22:01.523039Z

@james.landrein - i see what you mean, but an OR regex in the right order with a list of replacements inside clojure.string/replace is so convenient 🙂

Jakob Durstberger 2023-12-01T17:22:28.719909Z

I am also trying to record a video for each day. I have to say, I really struggled with the overlapping numbers 😬 https://youtu.be/7zD4OYcqaWI

👀 1
maleghast 2023-12-01T17:22:37.539549Z

@borkdude - I agree, but having Clojure to hand i didn't go near regex for part1

Jakob Durstberger 2023-12-01T17:23:36.859619Z

@maleghast, spotted your string/replace solution and had my mind blown 😄

🙇 2
maleghast 2023-12-01T17:24:27.271829Z

Glad you liked it @jakob.durstberger

👍 2
genmeblog 2023-12-01T17:25:57.404499Z

@maleghast when you replace, both ends are still in the string and the next substitution works. oneightwo becomes o1ei8ght2o

🤯 1
maleghast 2023-12-01T17:26:43.762379Z

That is so cool 😎

maleghast 2023-12-01T17:26:47.692539Z

I love that

genmeblog 2023-12-01T17:26:58.273819Z

Me too! Clever.

maleghast 2023-12-01T17:27:12.226519Z

Thanks I was blocking on why it would work - I appreciate the mental nudge 🙂

j4m3s 2023-12-01T17:27:44.739879Z

also, means you can do it in place and not allocate memory 😮 (although, not very clojurey)

Jakob Durstberger 2023-12-01T17:28:07.047399Z

I like that that approach works, but I think @maleghast way of replacing is easier to understand when reading the code. But again something I would not have thought of

vollcheck 2023-12-01T17:30:01.164679Z

I'm thinking also about recording a videos of that, but from the post-solution analysis perspective - do you think that might be interesting?

borkdude 2023-12-01T17:30:44.859899Z

Maybe a video of combining all of the coolest clojure hacks would be cool ;)

☝️ 3
maleghast 2023-12-01T17:31:12.478659Z

@j3k.walczak - I would say try it and find out..? I think that there is enough interest overall in AoC and it's a good way to get Clojure coolness out there

maleghast 2023-12-01T17:31:41.244629Z

I would definitely watch (once I had done the day's challenges)

Jakob Durstberger 2023-12-01T17:31:50.949689Z

Agreed! Go for it! I'd like to see a video that collected different approaches. I have learned about two different approaches by just reading this thread.

fingertoe 2023-12-01T17:33:40.608339Z

It would be interesting to see which approach is most performant, but also which one is easiest to look at, parse, and understand, and what that trade-off costs.

vollcheck 2023-12-01T17:34:40.439949Z

thank you people for the motivation and ideas! I will try to compile some stuff on the evening

maleghast 2023-12-01T17:34:47.406099Z

Here is my full solution in case you would like to share it: https://gist.github.com/maleghast/9bc7cd4851d0563de9686394b1debe37

👀 1
Jakob Durstberger 2023-12-01T17:35:22.337409Z

Mine using a regex look-ahead can be found here: https://github.com/JDurstberger/aoc-2023-clj/blob/main/src/day_1/core_2.clj

maleghast 2023-12-01T17:37:45.086719Z

Oh, that's how you do lookahead regexes 🙂

Jakob Durstberger 2023-12-01T17:38:44.477299Z

I honestly still don't understand them fully. I got it to work in that situation, but I am not certain I could correctly use it in other cases. Scratch that. It actually just clicked. To be fair, it does feel quite hacky now that I understand how it works 😕

borkdude 2023-12-01T17:38:56.155289Z

I made this (brute-force) overlapping re-seq because googling for this look-ahead syntax took too long ;)

(defn match-overlapping
  "re-seq with overlap" 
  [re s]
  (loop [matches []
         s s]
    (if-let [match (re-find re s)]
      (recur
          (conj matches match)
        (subs s (inc (.indexOf s match) 2)))
      (vec matches))))

👏 2
Ryan Martin 2023-12-01T17:39:34.617799Z

Here's my reversed regex solution: https://github.com/rmrt1n/advent-of-code-2023-clj/blob/main/src/aoc/day01.clj

j4m3s 2023-12-01T17:39:43.542929Z

I initially went the way to implement this through aggressive re-find use

borkdude 2023-12-01T17:40:31.122509Z

@hi897 Beautiful, I guess one could unduplicate that regex pattern with str/reverse and use re-pattern as well

😲 1
Jakob Durstberger 2023-12-01T17:42:25.036879Z

@hi897 that is brilliant! I wonder if you could extract the regex-pattern string before making it a regex and reverse it too so you don't need the eno|owt|... borkdude beat me to it

Ryan Martin 2023-12-01T17:43:05.120369Z

Yeah, didn't think about that earlier. Was just focused on getting a correct answer

borkdude 2023-12-01T17:43:15.450749Z

I think you can use clojure.pprint/cl-format to get the human names for numbers too, and then compose the regex from that ;)

🤯 3
😱 1
💛 1
maleghast 2023-12-01T17:43:48.100029Z

That would be fully awesome

borkdude 2023-12-01T17:44:24.301119Z

user=> (pp/cl-format nil "~r" 1)
"one"
just sayin'

👍 1
liebs 2023-12-01T17:44:30.339759Z

cl-format is such a great addition to the language, I'm doing this year's AOC in CL and I'm learning the ropes of format there and wow, what a tool

chaos 2023-12-01T18:26:23.889459Z

(solution in basilisp - a clojure compatible dialect for python) https://github.com/ikappaki/aoc23-basilisp/blob/master/day1.clj

🆒 2
Felipe 2023-12-01T18:29:00.193979Z

took me much much much longer than expected to get twone right

borkdude 2023-12-01T18:32:21.122569Z

@chaos nice, never heard of basilisp!

Felipe 2023-12-01T18:32:29.246499Z

wait what, clojure.string/reverse is a thing?

wevrem 2023-12-01T18:37:56.328689Z

After reading this thread, I did a version 2 with reversed string and reversed regex which I like better than my original version with “fancy” regex. https://github.com/wevre/advent-of-code/blob/master/src/advent_of_code/2023/day_01_trebuchet_v2.clj

👀 1
chaos 2023-12-01T18:39:36.897289Z

(@borkdude I've recently ported the https://github.com/basilisp-lang/basilisp/pull/723 to it, I was waiting for the basilisp author to review it before contacting you with regards to copyright and credits. It's amazing how much effort he has put to it. I've been using it for a while and thought to put it on the test with AoC)

borkdude 2023-12-01T18:48:23.391919Z

@chaos awesome :)

Chase 2023-12-01T18:52:09.393369Z

https://github.com/chase-lambert/aoc-clojure/blob/main/src/aoc/2023/day_01.clj holy schnikeys, was not expecting Part 2 to hit that hard on Day 1. I finally looked up how to do overlapping regexes when I figured out why the example data was passing but not the real stuff. My solution is ugly and probably horrifically inefficient as of now. I may have talked a couple of new programmers into trying AOC with promises the first few days are easy. lol oops

mrnhrd 2023-12-01T18:53:07.522529Z

Part 2 of this was so hard for me being a clj beginner who doesn't like regex, I just cheated by looking at solutions here. What a day 1. I feel the overlap thing ought to be possible to do with seq and stuffs.

Felipe 2023-12-01T18:55:51.306719Z

@m.reinhard it was hard for me too as a non-beginner who likes regex

➕ 3
fingertoe 2023-12-01T18:56:44.906509Z

Interestingly, the imperative folks don’t seem to be having as much trouble. Their first instinct is to index everything, while our first instinct to first/last leads us astray, I suspect?

Casey 2023-12-01T18:59:39.500359Z

Yea there's lots of talk (her and HN) about it being hard but I feel like it wasn't that difficult if you didn't try to use regex for part 2.

Casey 2023-12-01T19:00:51.222349Z

I just parsed the strings into a map of pos-->digit, keys, sort, first/last

Casey 2023-12-01T19:02:01.378149Z

Of course saying it's easy or not easy (overall ) is a hard judgement to make, as one is clouded by their experience

Sam Ferrell 2023-12-01T19:02:12.006229Z

some implementations accidentally picked the right arbitrary overlap rule, some did not

tschady 2023-12-01T19:02:59.242529Z

@tsulej’s two -> t2o is my kind of solution, your yearly reminder to punch AOC input until it quacks.

🦆 2
❤️ 1
genmeblog 2023-12-01T19:06:54.754609Z

regex solution was obvious for me, but this kind of hacking is the best one :)

Felipe 2023-12-01T19:09:10.319689Z

@ramblurr I think the hard part is realizing that overlaps can happen. even when I did notice it I missed that you can't just replace the first occurrence, reverse the string and do the same to find the last one, because if you have simply twone it becomes 2ne

Felipe 2023-12-01T19:09:40.858429Z

in a funny way I was bitten by "mutability" in a mostly immutable language

Sam 2023-12-01T19:19:41.031739Z

Dodging regex until I die. eightwothree becomes eight8eighttwo2twothree3three.

(def literal->digit 
              [["one" "1"]
              ["two" "2"]
              ["three" "3"]
              ["four" "4"]
              ["five" "5"]
              ["six" "6"]
              ["seven" "7"]
              ["eight" "8"]
              ["nine" "9"]])

(def star2 "54591"
  (problem1 (reduce (fn [s [literal digit]]
                (string/join
                 (str literal digit literal)
                 (string/split s (re-pattern literal))))
              input
              literal->digit)))

Cora (she/her) 2023-12-01T19:32:04.654939Z

my solutions using squint https://gist.github.com/corasaurus-hex/c5e4a9e31b36a5b1bedabc4778309d4c

Cora (she/her) 2023-12-01T19:32:38.612769Z

some of it is probably suboptimal

borkdude 2023-12-01T19:39:18.964309Z

you can read the puzzle input using fetch-input

borkdude 2023-12-01T19:40:38.264249Z

Cmd-Enter evaluates expressions (or the Windows key on other kbds)

borkdude 2023-12-01T19:41:13.643749Z

and then you can hit "Share" + copy the url to share

👍🏻 1
2023-12-01T19:41:44.680549Z

(def name->num {"one"   1
                "two"   2
                "three" 3
                "four"  4
                "five"  5
                "six"   6
                "seven" 7
                "eight" 8
                "nine"  9
                "1"     1  
                "2"     2
                "3"     3
                "4"     4
                "5"     5
                "6"     6
                "7"     7
                "8"     8
                "9"     9})

(defn starts-with-num [s]
  (loop [ss s]
    (or (some (fn [[k v]]
                (when (clojure.string/starts-with? ss k)
                  v))
              name->num)
        (recur (subs ss 1)))))

(defn ends-with-num [s]
  (loop [ss s]
    (or (some (fn [[k v]]
                (when (clojure.string/ends-with? ss k)
                  v))
              name->num)
        (recur (subs ss 0 (dec (count ss)))))))

(defn cal-val [input]
  (->> input
       ((juxt starts-with-num ends-with-num))
       (apply str)
       read-string))

(-> "aoc/day1input.txt"
    slurp
    (clojure.string/split #"\n")
    (->> (map cal-val)
         (reduce +)))

Janet A. Carr 2023-12-01T19:58:59.137039Z

my solution after figuring out the annoying 'regex' issue:

(ns advent-of-code.day-one
  (:require [clojure.string :as s]))

(defn part-one
  []
  (apply + (map (fn [line]
                  (let [numbers (re-seq #"\d" line)
                        num (str (first numbers)
                                 (last numbers))]
                    (try
                      (Integer/parseInt num)
                      (catch Exception e
                        (println "that's what you get for impurity")
                        0))))
                (line-seq ( "./input/day1.txt")))))

(defn part-two
  []
  (apply + (map (fn [line]
                  (let [lookup {"one" "1" "two" "2" "three" "3" "four" "4"
                                "five" "5" "six" "6" "seven" "7" "eight" "8" "nine" "9"}
                        numbers (->> line
                                     (re-seq #"(?=(\d|one|two|three|four|five|six|seven|eight|nine))")
                                     (map second)
                                     (map #(get lookup % %)))
                        num (str (first numbers)
                                 (last numbers))]
                    (try
                      (Integer/parseInt num)
                      (catch Exception e
                        (println "that's what you get for impurity")))))
                (line-seq ( "./input/day1.txt")))))

🎉 1
oyakushev 2023-12-01T20:01:11.811379Z

BTW, Clojure 1.11 added parse-long that can be used instead of Integer/parseInt.

👆 2
borkdude 2023-12-01T20:01:52.816559Z

keep parse-long is a very nice idiom for this

Janet A. Carr 2023-12-01T20:01:57.061519Z

@alexyakushev I couldn't remember what it was called. lol

Janet A. Carr 2023-12-01T20:02:29.728059Z

parse-int? nope throws an error. Just going to do the dirty parseInt.

🗿 1
borkdude 2023-12-01T20:02:35.341829Z

it basically does what you have written :)

borkdude 2023-12-01T20:02:42.682519Z

except that it returns nil

Janet A. Carr 2023-12-01T20:02:43.213299Z

I know. haha

borkdude 2023-12-01T20:02:49.085099Z

hehe alright

Janet A. Carr 2023-12-01T20:02:53.949819Z

It also won't insult me. haha

😆 1
mrnhrd 2023-12-01T20:11:05.469449Z

(def digit-strings 
    ["one" "two" "three" "four"
     "five" "six" "seven" "eight" "nine" 
     "1" "2" "3" "4" "5" 
     "6" "7" "8" "9"])

  (->> digit-strings 
       (map #(vector (str/index-of "xtwone3four" %) %))
       (filter first)
       (into (sorted-map))); => {1 "two", 3 "one", 6 "3", 7 "four"}
pseudo-edit: now if only index-of returned the indexes of all occurences 🙄

wevrem 2023-12-01T20:24:46.218109Z

or add in using str/last-index-of

👀 1
Cora (she/her) 2023-12-01T20:30:56.767579Z

converted my solution over to the squint playground https://squint-cljs.github.io/squint/?boilerplate=https%3A%2F%2Fgist.githubusercontent.com%2Fborkdude%2Fcf94b492d948f7f418aa81ba54f428ff%2Fraw%2Fa7da6236e9670681a93761b81fd66ad26c119164%2Faoc_ui.cljs&repl=true&src=OzsgSGVscGVyIGZ1bmN0aW9uczoKOzsgKGZldGNoLWlucHV0IHllYXIgZGF5KSAtIGdldCBBT0MgaW5wdXQKOzsgKGFwcGVuZCBzdHIpIC0gYXBwZW5kIHN0ciB0byBET00KOzsgKHNweSB4KSAtIGxvZyB4IHRvIGNvbnNvbGUgYW5kIHJldHVybiB4CgooZGVmbiBzbHVycAogIFtwcm9ibGVtXQogIChmZXRjaC1pbnB1dCAyMDIzIHByb2JsZW0pKQoKKGRlZm4gcGFyc2UtbGluZXMKICBbc10KICAoLT4gcyBzdHIvdHJpbSBzdHIvc3BsaXQtbGluZXMpKQoKKGRlZiB0ZXh0LT5kaWdpdAogIHsib25lIiAxCiAgICJ0d28iIDIKICAgInRocmVlIiAzCiAgICJmb3VyIiA0CiAgICJmaXZlIiA1CiAgICJzaXgiIDYKICAgInNldmVuIiA3CiAgICJlaWdodCIgOAogICAibmluZSIgOQogICAiMSIgMQogICAiMiIgMgogICAiMyIgMwogICAiNCIgNAogICAiNSIgNQogICAiNiIgNgogICAiNyIgNwogICAiOCIgOAogICAiOSIgOX0pCgooZGVmbiBtYXRjaC1udW1iZXJzLTEKICBbc10KICAoZG9hbGwgKHJlLXNlcSAjIlxkIiBzKSkpCgooZGVmIG51bWJlci1yZWdleHAKICAiUG9zaXRpdmUgbG9va2FoZWFkIHNvIHRoYXQgd2UgY2FuIGdldCBvdmVybGFwcGluZyBtYXRjaGVzLiIKICAoanMvUmVnRXhwLiAiKD89KG9uZXx0d298dGhyZWV8Zm91cnxmaXZlfHNpeHxzZXZlbnxlaWdodHxuaW5lfFxcZCkpIiAiZyIpKQoKKGRlZm4gbWF0Y2gtbnVtYmVycy0yCiAgW3NdCiAgKC0%2BPiAoLm1hdGNoQWxsIHMgbnVtYmVyLXJlZ2V4cCkKICAgICAgIChtYXB2ICMoZ2V0ICUgMSkpKSkKCihkZWZuIG1hdGNoZXMtPm51bWJlci0xCiAgW3hzXQogIChqcy9wYXJzZUludCAoc3RyIChmaXJzdCB4cykgKGxhc3QgeHMpKSkpCgooZGVmbiBtYXRjaGVzLT5udW1iZXItMgogIFt4c10KICAobGV0IFtudW1iZXJzIChtYXB2IHRleHQtPmRpZ2l0IHhzKV0KICAgIChqcy9wYXJzZUludCAoc3RyIChmaXJzdCBudW1iZXJzKSAobGFzdCBudW1iZXJzKSkpKSkKCigtPj4gKGpzL2F3YWl0IChzbHVycCAxKSkKICAgICBwYXJzZS1saW5lcwogICAgIChtYXAgbWF0Y2gtbnVtYmVycy0xKQogICAgIChtYXAgbWF0Y2hlcy0%2BbnVtYmVyLTEpCiAgICAgKHJlZHVjZSArKQogICAgIGFwcGVuZCkKCigtPj4gKGpzL2F3YWl0IChzbHVycCAxKSkKICAgICBwYXJzZS1saW5lcwogICAgIChtYXAgbWF0Y2gtbnVtYmVycy0yKQogICAgIChtYXAgbWF0Y2hlcy0%2BbnVtYmVyLTIpCiAgICAgKHJlZHVjZSArKQogICAgIGFwcGVuZCk%3D

borkdude 2023-12-01T20:32:56.507999Z

@corasaurus-hex awesome, got the same answers using my unique puzzle input 🎉 🎉

🎉 2
mrnhrd 2023-12-01T20:52:55.078119Z

Newb solution to part2 (part1 fell victim to my edit history): https://gist.github.com/mrnhrd/a544b725b865015ec88c9f1c10cad718 (thanks @michaeljweaver)

👀 1
pez 2023-12-01T22:37:08.069399Z

That was a bit harder for me than day 1 usually is.

(defn part-1 [input]
  (->> input
       (map (fn [line]
              [(re-find #"(?<=^\D*)\d" line)
               (re-find #"\d(?=\D*$)" line)]))
       (map #(apply str %))
       (map edn/read-string)
       (apply +)))

(def spelled ["one" "two" "three" "four" "five" "six" "seven" "eight" "nine"])
(def spelled->digit (into {}
                          (concat (map (fn [i s]
                                         [s (str i)])
                                       (range 1 10)
                                       spelled)
                                  (map (fn [d] [(str d) (str d)])
                                       (range 1 10)))))
(def pattern (re-pattern (str "(?=(" (string/join "|" (sort (keys spelled->digit))) "))")))

(defn part-2 [input]
  (->> input
       (map (fn [line]
              [(spelled->digit (second (first (re-seq pattern line))))
               (spelled->digit (second (last (re-seq pattern line))))]))
       (map #(apply str %))
       (map edn/read-string)
       (apply +)))

👀 1
dpsutton 2023-12-02T04:28:46.051509Z

(defn parse-line
  [f g line]
  (let [digits (f line)]
    (assert (seq digits) (format "no digits found in `%s`" line))
    (parse-long (str (g (first digits)) (g (peek digits))))))

(defn solve-b
  ([]
   (solve-b (slurp "src/day01.txt")))
  ([input]
   (let [g       (merge (zipmap (map str (range 10)) ;; string keys
                                (map str (range 10)))
                        (zipmap ["one" "two" "three" "four"
                                 "five" "six" "seven" "eight" "nine"]
                                (map str (next (range 10)))))
         pat     (re-pattern (str "(?=(" (str/join "|" (keys g)) "))"))
         f       (fn [line] (into [] (map second) (re-seq pat line)))
         extract (partial parse-line f g)]
     (apply + (map extract (str/split-lines input))))))

dpsutton 2023-12-02T04:30:36.829199Z

the overlap was a nasty day one addition 🙂

➕ 3
2023-12-02T05:41:38.543519Z

https://github.com/Aziiz1989/AOC2023/blob/main/src/aziz/day01.clj my first time participating in AOC

🙌 2
glallen 2023-12-04T08:04:56.616219Z

I totally forgot about regex lookahead ... and went brute force: https://github.com/glallen01/aoc/blob/5ed0f6b4717e0e64c52f34d03ea8004cd5d74fd0/2023/1.clj#L71-L100

alpox 2023-12-04T08:22:23.223289Z

I didn’t think of lookahead sometime and went with a reverse regex instead as well…

(ns adoc1
  (:require
   [clojure.string :as str]
   [ :as io]))

(def input (slurp (io/resource "adv1.txt")))

(def all '("1" "2" "3" "4" "5" "6" "7" "8" "9" "one" "two" "three" "four" "five" "six" "seven" "eight" "nine"))

(def number-words
  (into {} (map vector
                (take 9 (drop 9 all))
                (take 9 all))))

(defn make-pattern [s]
  (re-pattern (str "(" (str/join "|" s) ")")))

(def reverse-str (comp str/join reverse))

(def pattern (make-pattern all))
(def pattern-inverse (make-pattern (map reverse-str all)))

(defn find-pattern [p s]
  (first (re-find p s)))

(def match-pattern
  (juxt #(find-pattern pattern %)
        #(reverse-str (find-pattern pattern-inverse (reverse-str %)))))

(defn parse-number [line]
  (->>
   line
   (match-pattern)
   (map (fn [v] (get number-words v v)))
   (str/join "")
   (parse-long)))
  
(defn part2 [input]
  (->> input
       (str/split-lines)
       (map parse-number)
       (apply +)))

(part2 input)

mauricio.szabo 2023-12-04T15:21:51.722919Z

Wait - these twone, eightwo, are a thing??? I solved mine without worrying about it, and somehow it worked fine thinking-face

👀 1
Jakob Durstberger 2023-12-04T15:22:46.503009Z

Maybe you were incredibly lucky with your input data? If they are places in the middle then it would never affect the outcome? Or your solution just handles them anyway? 😄

2023-12-04T15:23:25.179179Z

@mauricio.szabo maybe you used overlapping regex which is a thing I just learned about 2 days ago

pez 2023-12-04T15:23:49.536259Z

Where’s your solution, @mauricio.szabo? I’m curious now. I think everybody’s input has that trap installed.

pez 2023-12-04T15:24:44.913479Z

Thanks. Will try on my input now. 😃

pez 2023-12-04T15:27:52.149229Z

Works like a charm! Now must look closer at the solution. 😃

mauricio.szabo 2023-12-04T15:37:40.526979Z

Wow... I literally just did the simplest thing I could think of 🤣

2023-12-04T15:43:28.609759Z

🍿

alpox 2023-12-04T15:44:25.866319Z

@mauricio.szabo I’m pretty sure yours just worked out due to the eager nature of regexes .* 😄 I wouldn’t have thought of using that…

pez 2023-12-04T15:44:37.013619Z

I really don’t understand why it works on the input data, though.

(real-digit "eightwo") ;=> ("eight" "eight")
Which isn’t right….

wheat 2023-12-04T16:43:08.399889Z

bit late to the party, but this was my solution for day 1 (i am v new to clojure and didn't know about juxt, parse-long, or any of the fancy regex stuff previously mentioned): https://gist.github.com/cantwellnc/9111dca58d619d3cf9f3a086b024a693 would def take some constructive criticism on how to write more idiomatically 😄

tschady 2023-12-04T18:24:05.363289Z

@cantwell.nc checkout keep instead of map and try out clojure.string/replace , might simplify your code

👍 1
2023-12-04T20:23:22.064189Z

I think @alpox is right about @mauricio.szabo solution. It should mean that there is no input in which the only numbers are in the form of eightwo or twone , but most solutions will account for that case.

tschady 2023-12-05T01:59:40.363319Z

Refactored with that awesome replacement hack @tsulej mentioned: https://github.com/tschady/advent-of-code/blob/main/src/aoc/2023/d01.clj

👍 1
2023-12-03T20:17:38.831159Z

https://squint-cljs.github.io/squint/?boilerplate=https%3A%2F%2Fgist.githubusercontent.com%2Fborkdude%2Fcf94b492d948f7f418aa81ba54f428ff%2Fraw%2F3e871513ab6f2462841f75fc99668f841f33dabb%2Faoc_ui.cljs&repl=true&src=OzsgSGVscGVyIGZ1bmN0aW9uczoKOzsgKGZldGNoLWlucHV0IHllYXIgZGF5KSAtIGdldCBBT0MgaW5wdXQKOzsgKGFwcGVuZCBzdHIpIC0gYXBwZW5kIHN0ciB0byBET00KOzsgKHNweSB4KSAtIGxvZyB4IHRvIGNvbnNvbGUgYW5kIHJldHVybiB4CgooZGVmIGlucHV0ICgtPj4gKGpzLWF3YWl0IChmZXRjaC1pbnB1dCAyMDIzIDEpKQogICAgICAgICAgICAgc3RyL3NwbGl0LWxpbmVzKSkKCihkZWZuIGZpcnN0LWFuZC1sYXN0LWRpZ2l0cwogIFtzXQogIChsZXQgW2RpZ2l0cyAodmVjIChyZS1zZXEgIyJcZCIgcykpXQogICAgKHBhcnNlLWxvbmcgKHN0ciAoZmlyc3QgZGlnaXRzKSAobGFzdCBkaWdpdHMpKSkpKQoKKGRlZm4gcGFyc2UtZGlnaXQKICBbc10KICAob3IKICAgIChnZXQgeyJvbmUiIDEKICAgICAgICAgICJ0d28iIDIKICAgICAgICAgICJ0aHJlZSIgMwogICAgICAgICAgImZvdXIiIDQKICAgICAgICAgICJmaXZlIiA1CiAgICAgICAgICAic2l4IiA2CiAgICAgICAgICAic2V2ZW4iIDcKICAgICAgICAgICJlaWdodCIgOAogICAgICAgICAgIm5pbmUiIDl9IHMpCiAgICAocGFyc2UtbG9uZyBzKSkpCgooZGVmbiBmaXJzdC1hbmQtbGFzdC1kaWdpdHMyCiAgW3NdCiAgKGxldCBbZmlyc3QtZGlnaXQgKC0%2BICh2ZWMgKHJlLXNlcSAjIlxkfG9uZXx0d298dGhyZWV8Zm91cnxmaXZlfHNpeHxzZXZlbnxlaWdodHxuaW5lIiBzKSkKICAgICAgICAgICAgICAgICAgICAgIGZpcnN0CiAgICAgICAgICAgICAgICAgICAgICBwYXJzZS1kaWdpdCkKICAgICAgICBsYXN0LWRpZ2l0ICgtPiAodmVjIChyZS1zZXEgIyIuKihcZHxvbmV8dHdvfHRocmVlfGZvdXJ8Zml2ZXxzaXh8c2V2ZW58ZWlnaHR8bmluZSkiIHMpKQogICAgICAgICAgICAgICAgICAgICBmaXJzdAogICAgICAgICAgICAgICAgICAgICBzZWNvbmQKICAgICAgICAgICAgICAgICAgICAgcGFyc2UtZGlnaXQpXQogICAgKCsgKCogMTAgZmlyc3QtZGlnaXQpIGxhc3QtZGlnaXQpKSkKCigtPj4gaW5wdXQKICAobWFwIGZpcnN0LWFuZC1sYXN0LWRpZ2l0cykKICAoYXBwbHkgKykKICBhcHBlbmQpCgooLT4%2BIGlucHV0CiAgKG1hcCBmaXJzdC1hbmQtbGFzdC1kaWdpdHMyKQogIChhcHBseSArKQogIGFwcGVuZCk%3D using the squint playground

🎉 1
2023-12-01T14:44:03.336639Z

Oh no - off by one error! I thought AOC started tonight, not last night...

1
borkdude 2023-12-01T14:45:35.266489Z

It's never too late to start :)

borkdude 2023-12-01T14:45:59.293489Z

(unless you have leaderboard ambitions)

2023-12-01T14:46:16.876309Z

Well, not for day 1 at least 🙂

Ellis 2023-12-01T14:47:33.209909Z

I was up at 5am by accident and by the time I solved it I still only got 7777 😄 Leaderboard is too timezone favoured for me to care about it

borkdude 2023-12-01T14:47:56.511729Z

I'm only in it for the fun and to improve #squint this year ;)

Ellis 2023-12-01T14:48:23.438749Z

Yeah I'm only for the fun now 😄 And a good excuse to show off some cool #clerk viewers

👍 1
borkdude 2023-12-01T14:49:40.172879Z

I guess you could also try it out the live in-browser editor feature in clerk ;) https://snapshots.nextjournal.com/clerk/build/ad8e5a2c19aa55921ea357fa9005d563f80c53be/editor/

Ellis 2023-12-01T14:50:11.229129Z

I could, but then I'd have to leave Emacs 😉 I get the same workflow in Emacs with xwidgets

borkdude 2023-12-01T14:50:37.374289Z

fair enough :)

nbardiuk 2023-12-01T15:01:04.631059Z

My off by one error was in time zone conversion - when I opened AoC the task was available for an hour already

Ingy döt Net 2023-12-01T15:30:51.113789Z

This is not AoC but it is very Advent, Code and Clojure... I'm publishing a Programming Advent blog about my new programming language, YAMLScript. I've announced it in other channels as: > YAMLScript is live today! https://yamlscript.org/posts/advent-2023/dec-01/ > I've been working on YAMLScript nonstop since my https://www.youtube.com/watch?v=9OcFh-HaCyI about it when @pez noticed and invited me here. > YAMLScript is billed as a new programming language that can be use for general purpose programming or embedding in YAML data files for dynamic transformation of the content. > In reality YAMLScript compiles/transpiles to Clojure code and is evaluated with SCI. > The ys runtime binary CLI is GraalVM compiled and libyamlscript.so can be bound to almost any programming language. > YAMLScript plans to ship as a dynamic YAML config loading module/binding to dozens of programming languages. > The language is written in Clojure of course. > Please join #yamlscript if you to discuss it further.

🎉 3
Chase 2023-12-01T19:41:41.548339Z

https://old.reddit.com/r/adventofcode/comments/188bpfg/2023_day_1_playdate_cranked_solution/ I love these aspects of AOC

❤️ 2
Chase 2023-12-01T22:35:41.610099Z

I won't make a habit of sharing all the subreddit stuff but Rockstar is one wild language! https://old.reddit.com/r/adventofcode/comments/1883ibu/2023_day_1_solutions/kbifxzl/

2023-12-01T19:54:05.673469Z

these elves are very incompetent!