Oh indeed, but it’s normally quite straightforward in the first few days. Certainly my terrible solution today is longer than any in the first maybe 10 days of last year.
What’s a “funge program”? [edit, oh befunge-like I guess]
Yep, funge has been used to describe any kind of multi-dimensional programming language - often with self-modifying code, I've personally found both 3D and 4D funge languages.
There's just something with the whole concept that amuses me, I've been trying to build some kind of funge-style programming puzzle game for a while now, but haven't figured out a good hook to take it past being just a PoC yet.
Is there usually less parsing? I haven't participated in previous years. (I guess I can just check the previous years' problems, but there are a lot of those.)
So far I've usually had success with just going for regex, but the second challenge today bacfired quite spectacullary. I'm still postponing having to rewrite my solution, because unfortunately it's not really possible to have 2D regex (as far as I know, would be awesome).
I guess just going with some kind of flood algorithm will be the way to go, but that's effort
Day one really got me with those pesky overlapping words like eightwo or twone.
Today was actually really easy the way I did it.
I searched through all the characters of the lines and when I got one that wasn't a number or a period, I looked at all the 8 places around to find the numbers. The numbers I completed by looking in both directions until I got a non-number.
Then I put all numbers and their starting positions in an array, deleted the duplicates and summed them.
Yeah it looks like the better solutions generally took that route. I convinced myself that the symbols were going to all have different rules in part 2, so ended up thinking about it way too hard for day 3 😀
I haven't been parsing the input string character by character and instead have been parsing into native data structures. It makes the code more verbose but it's how I want to do it. Unfortunately it does mean most of the time coming up with a solution is structuring the data so I'm hoping I come up with a faster way after a few days.
Yeah, I couldn’t see a nice approach today so I fell back on an existing Grid class I’ve used in previous years. Having those existing tools helps a lot.
I'm still working on my part 1 😭 string parsing makes me feel so stupid haha. But I'm adamant on coming up with a "nice" solution even if the number of lines aren't minimal. I've got something quite nice at the moment and I anticipate coming in under 100 lines (including whitespace, comments, and formatting).
I went with a matrix approach and was just planning to handle it through indexes but kinda gave up halfway implementing the finding of numbers, their start/end positions... I'm guessing a regex but that might have issues if we have identical numbers later, so not sure. Will surely go back to it eventually though :P
I have a Grid class from previous years so I sort of fell into that approach too. Once you’ve got the groundwork into place the solution is not so hard to get to. Hopefully I won’t have to think so hard tomorrow!
care animal sun fiction whistle ball rain flag angry minute give secretary water strong private stem board hair even stop still shake political silver name war dog blood change change under glass tooth top story expansion house future card note map observation full bottle back music door existence medical judge
ever solid office writing grass any north cover bell daughter salt square face knot event again letter living secretary land pleasure bee other burn short chance political new cheese writing paper strong fear list nail meal regular soft cow key brick purpose leather arm last fear instrument wheel who paint
fertile before yesterday stage regret protest kick necessary male some almost daughter surprise so nose history healthy amount pen special building natural care language past insect market umbrella size night hard rough pump with chief or run chin behaviour living effect glass deep no poor ice comb tight acid where
only friend ever value same pot stocking salt shake size silk self coat if development harmony loss seat pump jewel thin dirty short rat digestion ink poison manager floor winter insect such fact representative muscle dress ink lift powder reward mouth tray need like news birth talk servant till hope
goat poor quick band smash match death cry such cake sister office design spade very danger spring flag ice for stone street such weight range vessel rain fixed wood much learning right west delicate opposite low throat regret porter back circle some angle bucket wind tree please comb dead angry
come bucket quick all parcel strange friend drop balance balance for than skirt take present leather present page north by mixed danger important market spring then fold station trick separate argument end great yellow glove prose while medical jelly salt open slope oil orange verse law umbrella on change sort
existence lock red fork hate opposite hammer steam bit expert almost safe trousers crack together grey under ring stone chance bent regret range touch how seed store finger first new a competition conscious quiet lock sweet warm pleasure swim left heat brake toe carriage snake note frequent exchange hope comfort
offer false let manager reason owner protest any motion book sad heat sort pen after verse blue protest coal street attention authority tail air map unit island for a wave screw shoe insurance sleep old control slope over green balance new full regular wind writing male high guide tongue the
under true stick sign guide brake expert connection fish reading man put star able power though payment poor seed collar sister true river send base crime bed sneeze finger when society left summer division paste office scissors wheel bent fat attack again different fish button instrument weather this almost wash
office crush private glove special normal agreement ill fork leaf still rub box gold work long army gun dress high private harbour brake produce hospital to who to leg foolish clock wash because disease wood test soup table healthy horse summer care wire bottle driving blade bath do enough sign
get shirt woman sex among operation out voice smash far stretch division learning leather society property hook heat cloud event help sharp wound danger wise person bright offer star limit early grey bent thunder selection or broken complex wax possible slope power rest fiction warm like neck from elastic warm
invention horse question error self humour wound stage gold flight mark heart kick flight common feeble grass east cut print about black roll cow advertisement earth branch change store young very baby sticky owner stitch slow bit for horse scale snake representative up eye prison year army now bread sad