this post was submitted on 01 Dec 2023
17 points (100.0% liked)
NotAwfulTech
384 readers
3 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
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Let's do this.
Day 1: Trebuchet?!
https://adventofcode.com/2023/day/1
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.