18
submitted 1 year ago* (last edited 1 year ago) by gerikson@awful.systems to c/notawfultech@awful.systems

Rules: no spoilers.

The other rules are made up as we go along.

Share code by link to a forge, home page, pastebin (Eric Wastl has one here) or code section in a comment.

you are viewing a single comment's thread
view the rest of the comments
[-] gerikson@awful.systems 4 points 1 year ago
[-] gerikson@awful.systems 4 points 1 year ago

Perl: https://github.com/gustafe/aoc2023/blob/main/d01-Trebuchet.pl

thoughts

I found this really tough for a day 1 problem. Because I don't really know regex, I did not know the secret to finding overlapping patterns. I quickly figured out that "twone" was a possibility, because it was in the example, but then I had to find other examples and hardcode them into my split pattern.

This isn't general, my input doesn't have 'sevenine' for example.

this post was submitted on 01 Dec 2023
18 points (100.0% liked)

NotAwfulTech

384 readers
1 users here now

a community for posting cool tech news you don’t want to sneer at

non-awfulness of tech is not required or else we wouldn’t have any posts

founded 1 year ago
MODERATORS