🦆 Everybody.Codes 2025 Quest 1 Solutions 🦆
Quest 1: Whispers in the Shell
- Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
- You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL
Link to participate: https://everybody.codes/
Ooh, challenges! Here we go!
I haven't really written any Haskell since last year's AoC, and boy am I rusty.
What do the
.s mean inaddWith f = (f .) . (+)?.means function composition in Haskell.(f .) . (+)is just an obscure way to write\x y -> f (x + y). It's not recommended to use this point-free style in production code, but it is sometimes fun to experiment with for challenges like this.So far I really like the difficulty level of EC, compared to AOC.
Quest 1 is pretty straightforward:
0..limite.g.min(limit, max(0, index))index mod names.lenuntil done =)My solution in Nim:
Full solution at Codeberg: solution.nim
my boring python solution:
I probably should read all 3 files though. I'll hone it out later.
I'm still learning Scheme, but I wrote a solution in Guile:
edit: I did the wrong quest
I wasn't very happy with myself on this one. Part 1 wound up being simple enough, but part 2 took me for a loop. My disappointment was that I asked an AI for a hint, but instead it coded up a solution revolved around checking cycle dependency.
I tried to at least redo it in a functional way, since I'm writing this in FSharp, but I ran into a bunch of hiccups around indexes and index tracking. That always costs me so much time. This took me forever and I'm near the bottom of the rankings haha.
Overall, I wasn't terribly happy with how I did on this one. Oh, I wound up switching all of the types to BigInteger because I was lost as to what was happening. It turned out to be indexes and orderings, but I thought that maybe something was getting truncated.
I'm very curious about F# since I've never used it or seen it anywhere before but I'm afraid I'm too tired to read it right now. Thank you for posting, I hope I'll remember to come back tomorrow.
Hmmm, I am certain I did the wrong one? I did quest 1, I'm pretty sure
Here's the right challenge. This was a lot simpler than the tracking of cycles.
Thank you for this update. Now that problwm and solution fit, I can understand whats going on in your code :]
yeah that must have been confusing 😂
I coded this along with my girlfriend who's learning python, but not motivated to share her solution. The program reads from stdin, because I usually invoke it like so:
runhaskell Main.hs < inputorrunhaskell Main.hs < example. I think this is quite handy because I don't have to change the source code to check the example input again.I struggled with Part 3, where I suddenly forgot I could've simply used
mod, which I ended up doing anyway. I immediately recognized that Part 3 needs Mutable Arrays if I care to avoid Index hell, which is not what I wanted to with Haskell but oh well.Short and simple Uiua solution :-)
-> "Fyrryn", "Elarzris", "Drakzyph"
ah, uiua, the only thing that makes me wish Unicode hadn't been invented :)
:-(
^ not valid Uiua code