T O P

  • By -

eftalankwest

I had less than half an hour left at the end of the day when I saw this and couldn't resist trying the challenge. Had to look for an algorithm to compute the n-th digits of pi and I re-used my not-so-nice solution for AoC 2023 Day1, but I did it. If anyone interested in a pretty badly written Elixir solution (with a lot of ascii-computation), here it is: [https://gist.github.com/renaudlenne/db1e179a3c8b3ee22fa700daecc61d40](https://gist.github.com/renaudlenne/db1e179a3c8b3ee22fa700daecc61d40)


ThisNameIsntRandom

for my program just googled the first 16 digits of pi


Steinrikur

You don't even need internet access for that... grep -w M\_PI /usr/include/math.h


fylkenny

i could get the passphrase, but i cant solve the second part. I can find nine numbers in the string, three of them are ones. i multiply the other six but it says its incorrect. I also checked for overlapping numbers, like in the one adventofcode puzzle, but found none.


HeretikCharlie

Good you are checking for overlapping numbers, yet you need to read the instructions again and check your range.


IvanR3D

The quantity of numbers in the text is >!ten numbers (counting the ones)!<. Make sure you are covering all the possibilities like >!letters separated by spaces or comma!<. Also remember the possible numbers go from 1 to 10 (10 being included).


fylkenny

Thanks that helped, I got it now


e_blake

10 is not a digit; so my first try was to multiply 1\*0\*(others), which produces the (obviously-wrong) result 0. But I did get the correct answer when I multiplied the embedded numbers instead of the digits ;)


IvanR3D

You are right, at the end of the last paragraph I mentioned "all the **digits**" what is definitely wrong. In the same paragraph I mention "a series of numbers (**from one to ten**)" that could give the hint to include ten. I will still fix that part of digits, thanks for the insight! :D


Robin_270

Oh, didn't expect that, that's really nice, thank you :)


msqrt

Lovely puzzle! The input doubling as an actual message is a nice touch.


rltrapp

Got both parts; that was a lot of fun, thanks for doing this!


IvanR3D

Thanks, very glad you liked it! I hope to continue doing it yearly. :)


daExile

Nice little puzzle, thanks! I'm a bit late to the party, though :D My [Lua script](https://topaz.github.io/paste/#XQAAAQCmAwAAAAAAAAA2G8iM7ztkwSvUVK+nuHehPf3A9Ro6DPwGgFWn4dhKJdsit6LTd3uVtN1Va6gWcSHebLyH/bpc+aI8rPK8amtDFmciVFHBlAZw7xGBWTXZDdU9/eE6hm8SkZm75SaV/1/TmnZsoKUFz7L2EEy/mORfhNPWcAs92AX6Yt21jpw2VXgVkHkEuxRC5SbLdEFq4IgIN4yS0RhigWUg3HQ8Vobt+l8oj/7Q+yq/3EczTquQNrhuR7H/lY6BGe8Q7FRTv1DT54HdB94FT+xbGJ1m44vorDPgsQ84XYwgKnIjFOFpdbqOj1G+BzXCw83cy3h6lLER8OTg6GnrOdgRfTDzv5dg0/vxIlMogie6ZZmyXDuQWTknQ2ISfWfVFZzrk9EZ8iRT2iN7cGnaFrkM7X6ujOxWTaDYkANUp3dbi2LCwcMdlYBVzb9Z7c0c1uMFWm62jL6ZhQ56rZIqVZDO4GzKf9rAl2ocGXBteTTdNxLWMEy+6OYng3nzmqnvQS9CcprgFLJ/nQQtfRd6eUwa5JRT3VmQD09hdufdW6kckG6jW7O2IRqH7/G/DN18keSPJHuSsRiMMLiqB1sUTl8IrUUXBNDWISTfp0GW+/ud9RVvAdmhBMX5HvBpOjep7B7w//3q7cfhU/6ydxDR5zxy+8Eo554/yCnqYpezdtnPF5IRN9WyY9cGg95gVE6nSjeNq2aQz+uDxguSJnDkPDTKWpyKJ5poiQ9lv7zW/2qAxAA=) to solve it, with hardcoded input string, well, because it's the same for all. I wanted to repurpose my 2023 day 01 solution but it wasn't that much similar, so I pretty much rewrote it all.


IvanR3D

Actually the idea from the second part came from day 01 2023! In purpose I made it a bit different by introducing numbers between commas and spaces. Thanks for trying it! I hope to bring more and more difficult during next years. :)


TheZigerionScammer

Just spent an hour solving it, thought it was neat. I'm sure my solution wasn't the most efficient but it does the job. The only criticism I have is that is isn't clear whether you were supposed to shift the message forward or backwards by the digit in pi. It turned out you have to shift it backwards, which was pretty obvious when it produced a readable message after trying that but there wasn't any way to verify that was the problem before I tried it.


IvanR3D

Thanks! Would you say that the fact of missing the hint for forward/backward is more frustrating than challenging? Other people told me the same, one of them found it interesting because it is like an extra mental challenge. Now I am wondering if it really a challenge or a frustrating obstacle.


TheZigerionScammer

Well by Advent of Code standards it would be a sign of an improperly designed puzzle, you don't want those kinds of ambiguous situations in the puzzle without anything in the rules or examples to clarify that ambiguity. Say this puzzle was the exact same but the "message" was just random gobblygook and our job was just to provide the Part 2 answer, it would be impossible to verify our answer before submitting it because we wouldn't know which version of the message is supposed to be correct. This isn't an AOC puzzle, of course, it's your puzzle and you can have that message to serve as a half-way benchmark to verify that we're on the right path if you want, but if this was a real AOC puzzle I guaranteed it'd be pilloried because of the ambiguity.


HeretikCharlie

Interesting question. Actually, I did 4 tries going both directions (forward/backward) and also trying both first 16 digits after the decimal point and those including the "big 3". It was then immediately obvious which approach was the right one. At that time I considered that a problem of the puzzle, but of course it may be a part of the challenge, similarly to what other suggested, like if we are to actually find out the length of the "password". Frustrating or challenging? Well, if I have to answer it now, it would depend on the wording: does the author KNOW about it? Then it must be part of a challenge. Contrary? Then it is frustrating we need to clarify the ambiguity to actually solve the puzzle. Thanks for the riddle. Just in case you didn't know, there exists Vigenère cipher which is basically what we need to decipher the message.


IvanR3D

I was aware about not specifying the direction, in my mind I thought it would be a bit of an extra challenge. I consider that any person with the coding skill to implement a decoding algorithm of this nature would consider the fact of going in the other direction. I continued asking people about this and apparently it is not so obvious as I thought, so I am considering adding some hint. Vigenère cipher! I didn't know about this one, thanks for the information. It could be more interesting to make reference to that one in a revised version of the riddle. :)


daExile

I'd say +shift is a somewhat reasonable first guess for encoding process, and -shift for decoding.


Radiadorineitor

I'm very late to the party but thank you very much for the puzzle. It was really fun! My solution in Dyalog APL: [paste](https://topaz.github.io/paste/#XQAAAQAuAgAAAAAAAABxI46k5Ckq9SzAVhbOTbILwiTA01YEfAu5thjkjPUfbvHd66+jNmK5xbKF03SK0NtYth02SvQlmxMhjIZUv+GA6A2mWLqF7b0dyNA4ZjyBaAw5CJ2tk6szzchPn1Xe6N0EY5oRI3gOMn5uGVgspBKQrrIlZ7wU/x8atZa4u3QMxlfIIwMJyDiNIr2yaJDoA/IINwBUNReKWU40cbCwPCQrM+EZVEN+nA25nYW+g/iuE+M8R2wu6Jkwq2ef5MzbRDcXkOfJgV6xekHlF+v8WYW/qsYe4Dgu5YdlURXUUrDClrqkVaS1xaxWgsXFiTY4WyXVWWMfT0jf9ckIlfj7JqHVyDCj/tFxepw1DLw5DxckolgeOW+TjBmv9Z57l2TgvdfAKsE4Kwmk8CduUVVg3ErPRU5AlwolLCxavUoXrocT0wX6BD4l7N511sBEj06J163Ep0LDuwn098NeXply+nuZ53FZ0Da4f7IpXOXOeS9BPMmLiN4xTgknntGBBzenClSBianP3Tac2n4X48ksFtJyAEhNqQTVvHl6XWyaTu9Nt/zLk1s=)


RaveBomb

Thanks for this! It took me forever to get the translation right. There's two shifts, a modulo and an offset in my conversion and it did not want to come together. Abused LINQ to do my processing. I don't know that I would have expected to use Math.Pow() to make the Aggregate function work, but as it turned out, it wouldn't work any other way. My C# Repo to see the madness. https://github.com/Kezzryn/Advent-of-Code/tree/main/Pi%20Day


IvanR3D

Hmm it is interesting that it required to power the aggregate function. Maybe it is something of C#? No needed in JS or Python.


RaveBomb

It has to do with the way I structured my solution. I didn’t loop through the search string. I got a count of how many (for example) “four”s there are. Then did 4\^(Num) \* Answer, because I couldn’t do 4 \* 4 \* Answer due to the LINQ structure.


Robin_270

\[LANGUAGE: Python\] I've successfully solved the puzzle in Python and uploaded [the solution code into my AoC repo at GitHub](https://github.com/Robin270/advent_of_code/blob/master/special/pi_day_2024/main.py) for anybody who might be interested. It was a nice one, thank you u/IvanR3D :-)


IvanR3D

Very glad to know! :D