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

NotAwfulTech

365 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
 

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
[–] [email protected] 4 points 1 year ago (11 children)
[–] [email protected] 4 points 1 year ago (10 children)

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.

load more comments (9 replies)
load more comments (9 replies)